This commit is contained in:
sunkaixuan
2022-02-26 22:19:54 +08:00
parent ca48ee64d2
commit 524637c2d7

View File

@@ -200,12 +200,10 @@ namespace SqlSugar
var result = new DbResult<bool>(); var result = new DbResult<bool>();
try try
{ {
var isAutoConfig = this.Context.CurrentConnectionConfig.IsAutoCloseConnection;
this.BeginTran(); this.BeginTran();
if (action != null) if (action != null)
action(); action();
this.CommitTran(); this.CommitTran();
this.Context.CurrentConnectionConfig.IsAutoCloseConnection = isAutoConfig;
result.Data = result.IsSuccess = true; result.Data = result.IsSuccess = true;
} }
catch (Exception ex) catch (Exception ex)