mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 18:22:23 +08:00
Synchronization code
This commit is contained in:
@@ -307,6 +307,8 @@ namespace SqlSugar
|
||||
Check.Exception(updateColumns == null || updateColumns.Count() == 0, "set columns count=0");
|
||||
var isAuto = this.context.CurrentConnectionConfig.IsAutoCloseConnection;
|
||||
this.context.CurrentConnectionConfig.IsAutoCloseConnection = false;
|
||||
var old = this.context.Ado.IsDisableMasterSlaveSeparation;
|
||||
this.context.Ado.IsDisableMasterSlaveSeparation = true;
|
||||
DataTable dt = ToDdateTable(datas);
|
||||
IFastBuilder buider = GetBuider();
|
||||
ActionIgnoreColums(whereColumns, updateColumns, dt, buider.IsActionUpdateColumns);
|
||||
@@ -321,6 +323,7 @@ namespace SqlSugar
|
||||
}
|
||||
this.context.CurrentConnectionConfig.IsAutoCloseConnection = isAuto;
|
||||
buider.CloseDb();
|
||||
this.context.Ado.IsDisableMasterSlaveSeparation = old;
|
||||
End(datas, false);
|
||||
return result;
|
||||
}
|
||||
@@ -374,6 +377,8 @@ namespace SqlSugar
|
||||
Check.Exception(updateColumns == null || updateColumns.Count() == 0, "set columns count=0");
|
||||
var isAuto = this.context.CurrentConnectionConfig.IsAutoCloseConnection;
|
||||
this.context.CurrentConnectionConfig.IsAutoCloseConnection = false;
|
||||
var old = this.context.Ado.IsDisableMasterSlaveSeparation;
|
||||
this.context.Ado.IsDisableMasterSlaveSeparation = true;
|
||||
dataTable.TableName = this.queryable.SqlBuilder.GetTranslationTableName(tableName);
|
||||
DataTable dt = GetCopyWriteDataTableUpdate(dataTable);
|
||||
IFastBuilder buider = GetBuider();
|
||||
@@ -397,6 +402,7 @@ namespace SqlSugar
|
||||
}
|
||||
this.context.CurrentConnectionConfig.IsAutoCloseConnection = isAuto;
|
||||
buider.CloseDb();
|
||||
this.context.Ado.IsDisableMasterSlaveSeparation = old;
|
||||
End(datas, false);
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user