mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-22 20:13:41 +08:00
Add SqlExecuteCount
This commit is contained in:
@@ -39,6 +39,10 @@ namespace SqlSugar
|
||||
internal bool OldClearParameters { get; set; }
|
||||
public IDataParameterCollection DataReaderParameters { get; set; }
|
||||
public TimeSpan SqlExecutionTime { get { return AfterTime - BeforeTime; } }
|
||||
/// <summary>
|
||||
/// Add, delete and modify: the number of affected items;
|
||||
/// </summary>
|
||||
public int SqlExecuteCount { get; private set; } = 0;
|
||||
public StackTraceInfo SqlStackTrace { get { return UtilMethods.GetStackTrace(); } }
|
||||
public bool IsDisableMasterSlaveSeparation { get; set; }
|
||||
internal DateTime BeforeTime = DateTime.MinValue;
|
||||
@@ -428,6 +432,8 @@ namespace SqlSugar
|
||||
int count = sqlCommand.ExecuteNonQuery();
|
||||
if (this.IsClearParameters)
|
||||
sqlCommand.Parameters.Clear();
|
||||
// 影响条数
|
||||
this.SqlExecuteCount = count;
|
||||
ExecuteAfter(sql, parameters);
|
||||
sqlCommand.Dispose();
|
||||
return count;
|
||||
|
@@ -31,6 +31,7 @@ namespace SqlSugar
|
||||
bool IsClearParameters { get; set; }
|
||||
int CommandTimeOut { get; set; }
|
||||
TimeSpan SqlExecutionTime { get; }
|
||||
int SqlExecuteCount { get; }
|
||||
IDbBind DbBind { get; }
|
||||
void SetCommandToAdapter(IDataAdapter adapter, DbCommand command);
|
||||
IDataAdapter GetAdapter();
|
||||
|
Reference in New Issue
Block a user