mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Synchronization code
This commit is contained in:
parent
0f04e00ba1
commit
c7cf1a5845
@ -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);
|
||||
@ -320,7 +322,8 @@ namespace SqlSugar
|
||||
this.context.DbMaintenance.DropTable(dt.TableName);
|
||||
}
|
||||
this.context.CurrentConnectionConfig.IsAutoCloseConnection = isAuto;
|
||||
buider.CloseDb();
|
||||
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,7 +402,8 @@ namespace SqlSugar
|
||||
}
|
||||
this.context.CurrentConnectionConfig.IsAutoCloseConnection = isAuto;
|
||||
buider.CloseDb();
|
||||
End(datas, false);
|
||||
this.context.Ado.IsDisableMasterSlaveSeparation = old;
|
||||
End(datas, false);
|
||||
return result;
|
||||
}
|
||||
private async Task<int> _BulkCopy(List<T> datas)
|
||||
|
Loading…
Reference in New Issue
Block a user