mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-12-02 03:13:58 +08:00
Update Tran
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user