Merge pull request #1481 from hyzx86/codefirstAOP

为部分 Command 增加 aop 支持
This commit is contained in:
2881099 2023-04-18 00:24:54 +08:00 committed by GitHub
commit 62f4e42307
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 16 additions and 0 deletions

View File

@ -481,6 +481,8 @@ where a.database in ({0}) and a.table in ({1})", 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

@ -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

@ -187,6 +187,8 @@ namespace FreeSql.GBase
{ {
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();
} }
} }