Update SqlExecuteCount

This commit is contained in:
sunkaixuan
2025-05-22 15:36:47 +08:00
parent e16f3a87b2
commit 18f99aeab4
2 changed files with 2 additions and 1 deletions

View File

@@ -46,7 +46,7 @@ namespace SqlSugar
/// <summary>
/// Add, delete and modify: the number of affected items;
/// </summary>
public int SqlExecuteCount { get; private set; } = 0;
public int SqlExecuteCount { get; protected set; } = 0;
public StackTraceInfo SqlStackTrace { get { return UtilMethods.GetStackTrace(); } }
public bool IsDisableMasterSlaveSeparation { get; set; }
internal DateTime BeforeTime = DateTime.MinValue;

View File

@@ -218,6 +218,7 @@ namespace SqlSugar
count = await sqlCommand.ExecuteNonQueryAsync(this.CancellationToken.Value);
if (this.IsClearParameters)
sqlCommand.Parameters.Clear();
SqlExecuteCount = count;
ExecuteAfter(sql, parameters);
sqlCommand.Dispose();
return count;