mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 18:22:23 +08:00
Update bulkCopy
This commit is contained in:
@@ -322,8 +322,8 @@ namespace SqlSugar
|
|||||||
this.context.DbMaintenance.DropTable(dt.TableName);
|
this.context.DbMaintenance.DropTable(dt.TableName);
|
||||||
}
|
}
|
||||||
this.context.CurrentConnectionConfig.IsAutoCloseConnection = isAuto;
|
this.context.CurrentConnectionConfig.IsAutoCloseConnection = isAuto;
|
||||||
|
buider.CloseDb();
|
||||||
this.context.Ado.IsDisableMasterSlaveSeparation = old;
|
this.context.Ado.IsDisableMasterSlaveSeparation = old;
|
||||||
buider.CloseDb();
|
|
||||||
End(datas, false);
|
End(datas, false);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -377,6 +377,8 @@ namespace SqlSugar
|
|||||||
Check.Exception(updateColumns == null || updateColumns.Count() == 0, "set columns count=0");
|
Check.Exception(updateColumns == null || updateColumns.Count() == 0, "set columns count=0");
|
||||||
var isAuto = this.context.CurrentConnectionConfig.IsAutoCloseConnection;
|
var isAuto = this.context.CurrentConnectionConfig.IsAutoCloseConnection;
|
||||||
this.context.CurrentConnectionConfig.IsAutoCloseConnection = false;
|
this.context.CurrentConnectionConfig.IsAutoCloseConnection = false;
|
||||||
|
var old = this.context.Ado.IsDisableMasterSlaveSeparation;
|
||||||
|
this.context.Ado.IsDisableMasterSlaveSeparation = true;
|
||||||
dataTable.TableName = this.queryable.SqlBuilder.GetTranslationTableName(tableName);
|
dataTable.TableName = this.queryable.SqlBuilder.GetTranslationTableName(tableName);
|
||||||
DataTable dt = GetCopyWriteDataTableUpdate(dataTable);
|
DataTable dt = GetCopyWriteDataTableUpdate(dataTable);
|
||||||
IFastBuilder buider = GetBuider();
|
IFastBuilder buider = GetBuider();
|
||||||
@@ -400,7 +402,8 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
this.context.CurrentConnectionConfig.IsAutoCloseConnection = isAuto;
|
this.context.CurrentConnectionConfig.IsAutoCloseConnection = isAuto;
|
||||||
buider.CloseDb();
|
buider.CloseDb();
|
||||||
End(datas, false);
|
this.context.Ado.IsDisableMasterSlaveSeparation = old;
|
||||||
|
End(datas, false);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
private async Task<int> _BulkCopy(List<T> datas)
|
private async Task<int> _BulkCopy(List<T> datas)
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
<package >
|
<package >
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>SqlSugarCore</id>
|
<id>SqlSugarCore</id>
|
||||||
<version>5.1.4.154-preview09</version>
|
<version>5.1.4.154-preview11</version>
|
||||||
<authors>sunkaixuan</authors>
|
<authors>sunkaixuan</authors>
|
||||||
<owners>果糖大数据科技</owners>
|
<owners>果糖大数据科技</owners>
|
||||||
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
|
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
|
||||||
|
Reference in New Issue
Block a user