mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Update bulkCopy
This commit is contained in:
parent
b9b6fb7f8e
commit
0f04e00ba1
@ -322,8 +322,8 @@ namespace SqlSugar
|
||||
this.context.DbMaintenance.DropTable(dt.TableName);
|
||||
}
|
||||
this.context.CurrentConnectionConfig.IsAutoCloseConnection = isAuto;
|
||||
buider.CloseDb();
|
||||
this.context.Ado.IsDisableMasterSlaveSeparation = old;
|
||||
buider.CloseDb();
|
||||
End(datas, false);
|
||||
return result;
|
||||
}
|
||||
@ -377,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();
|
||||
@ -400,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)
|
||||
|
@ -2,7 +2,7 @@
|
||||
<package >
|
||||
<metadata>
|
||||
<id>SqlSugarCore</id>
|
||||
<version>5.1.4.154-preview09</version>
|
||||
<version>5.1.4.154-preview11</version>
|
||||
<authors>sunkaixuan</authors>
|
||||
<owners>果糖大数据科技</owners>
|
||||
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
|
||||
|
Loading…
Reference in New Issue
Block a user