Update Tran

This commit is contained in:
sunkaixuan
2022-12-11 14:09:25 +08:00
parent 05d1a1cda0
commit f7293a5401

View File

@@ -303,10 +303,10 @@ namespace SqlSugar
var result = new DbResult<bool>();
try
{
this.BeginTran();
await this.BeginTranAsync();
if (action != null)
await action();
this.CommitTran();
await this.CommitTranAsync();
result.Data = result.IsSuccess = true;
}
catch (Exception ex)
@@ -314,7 +314,7 @@ namespace SqlSugar
result.ErrorException = ex;
result.ErrorMessage = ex.Message;
result.IsSuccess = false;
this.RollbackTran();
await this.RollbackTranAsync();
if (errorCallBack != null)
{
errorCallBack(ex);