Optimize the code

This commit is contained in:
sunkaixuan
2025-07-31 13:34:09 +08:00
parent 0d5a5110f4
commit df14c72cf1

View File

@@ -346,12 +346,12 @@ namespace SqlSugar
try try
{ {
this.BeginTran(); this.BeginTran();
var oldSave = this.Context.CurrentConnectionConfig.SlaveConnectionConfigs; var oldSlave = this.Context.CurrentConnectionConfig.SlaveConnectionConfigs;
this.Context.CurrentConnectionConfig.SlaveConnectionConfigs = null; this.Context.CurrentConnectionConfig.SlaveConnectionConfigs = null;
if (action != null) if (action != null)
action(); action();
this.CommitTran(); this.CommitTran();
this.Context.CurrentConnectionConfig.SlaveConnectionConfigs = oldSave; this.Context.CurrentConnectionConfig.SlaveConnectionConfigs = oldSlave;
result.Data = result.IsSuccess = true; result.Data = result.IsSuccess = true;
} }
catch (Exception ex) catch (Exception ex)