mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-01-23 05:11:59 +08:00
Optimized code
This commit is contained in:
@@ -208,6 +208,8 @@ namespace SqlSugar
|
||||
}
|
||||
|
||||
private async Task<int> _BulkMerge(List<T> datas, string[] updateColumns, string[] whereColumns)
|
||||
{
|
||||
try
|
||||
{
|
||||
Begin(datas, false, true);
|
||||
Check.Exception(whereColumns == null || whereColumns.Count() == 0, "where columns count=0 or need primary key");
|
||||
@@ -234,10 +236,18 @@ namespace SqlSugar
|
||||
End(datas, false, true);
|
||||
return result;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
this.context.Close();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Core
|
||||
private async Task<int> _BulkUpdate(List<T> datas, string[] whereColumns, string[] updateColumns)
|
||||
{
|
||||
try
|
||||
{
|
||||
Begin(datas, false);
|
||||
Check.Exception(whereColumns == null || whereColumns.Count() == 0, "where columns count=0 or need primary key");
|
||||
@@ -261,6 +271,12 @@ namespace SqlSugar
|
||||
End(datas, false);
|
||||
return result;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
this.context.Close();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private void ActionIgnoreColums(string[] whereColumns, string[] updateColumns, DataTable dt,bool IsActionUpdateColumns)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user