修改 Mysql, SqlServer ,Odbc AOP command 拦截

This commit is contained in:
hyzx86 2023-04-04 16:54:46 +08:00
parent b070494d8b
commit f73ec96572
6 changed files with 12 additions and 0 deletions

View File

@ -382,6 +382,8 @@ where a.table_schema IN ({0}) and a.table_name IN ({1}) and a.index_name <> 'PRI
{ {
cmd.CommandText = sql; cmd.CommandText = sql;
cmd.CommandType = CommandType.Text; cmd.CommandType = CommandType.Text;
var before = new Aop.CommandBeforeEventArgs(cmd);
this._orm?.Aop.CommandBeforeHandler?.Invoke(this._orm, before);
return cmd.ExecuteScalar(); return cmd.ExecuteScalar();
} }
} }

View File

@ -474,6 +474,8 @@ use [" + database + "];", tboldname ?? tbname);
{ {
cmd.CommandText = sql; cmd.CommandText = sql;
cmd.CommandType = CommandType.Text; cmd.CommandType = CommandType.Text;
var before = new Aop.CommandBeforeEventArgs(cmd);
this._orm?.Aop.CommandBeforeHandler?.Invoke(this._orm, before);
return cmd.ExecuteScalar(); return cmd.ExecuteScalar();
} }
} }

View File

@ -393,6 +393,8 @@ where a.table_schema IN ({0}) and a.table_name IN ({1}) and a.index_name <> 'PRI
{ {
cmd.CommandText = sql; cmd.CommandText = sql;
cmd.CommandType = CommandType.Text; cmd.CommandType = CommandType.Text;
var before = new Aop.CommandBeforeEventArgs(cmd);
this._orm?.Aop.CommandBeforeHandler?.Invoke(this._orm, before);
return cmd.ExecuteScalar(); return cmd.ExecuteScalar();
} }
} }

View File

@ -383,6 +383,8 @@ where a.table_schema IN ({0}) and a.table_name IN ({1}) and a.index_name <> 'PRI
{ {
cmd.CommandText = sql; cmd.CommandText = sql;
cmd.CommandType = CommandType.Text; cmd.CommandType = CommandType.Text;
var before = new Aop.CommandBeforeEventArgs(cmd);
this._orm?.Aop.CommandBeforeHandler?.Invoke(this._orm, before);
return cmd.ExecuteScalar(); return cmd.ExecuteScalar();
} }
} }

View File

@ -475,6 +475,8 @@ use [" + database + "];", tboldname ?? tbname);
{ {
cmd.CommandText = sql; cmd.CommandText = sql;
cmd.CommandType = CommandType.Text; cmd.CommandType = CommandType.Text;
var before = new Aop.CommandBeforeEventArgs(cmd);
this._orm?.Aop.CommandBeforeHandler?.Invoke(this._orm, before);
return cmd.ExecuteScalar(); return cmd.ExecuteScalar();
} }
} }

View File

@ -477,6 +477,8 @@ use [" + database + "];", tboldname ?? tbname);
{ {
cmd.CommandText = sql; cmd.CommandText = sql;
cmd.CommandType = CommandType.Text; cmd.CommandType = CommandType.Text;
var before = new Aop.CommandBeforeEventArgs(cmd);
this._orm?.Aop.CommandBeforeHandler?.Invoke(this._orm, before);
return cmd.ExecuteScalar(); return cmd.ExecuteScalar();
} }
} }