Update core

This commit is contained in:
sunkaixuna
2021-11-22 11:50:53 +08:00
parent dec730190a
commit b9234bf5ed
4 changed files with 8 additions and 3 deletions

View File

@@ -93,6 +93,7 @@ namespace SqlSugar
var result = await buider.UpdateByTempAsync(GetTableName(), dt.TableName, updateColumns, whereColumns); var result = await buider.UpdateByTempAsync(GetTableName(), dt.TableName, updateColumns, whereColumns);
this.context.DbMaintenance.DropTable(dt.TableName); this.context.DbMaintenance.DropTable(dt.TableName);
this.context.CurrentConnectionConfig.IsAutoCloseConnection = isAuto; this.context.CurrentConnectionConfig.IsAutoCloseConnection = isAuto;
buider.CloseDb();
End(datas); End(datas);
return result; return result;
} }

View File

@@ -13,5 +13,6 @@ namespace SqlSugar
Task<int> UpdateByTempAsync(string tableName,string tempName,string [] updateColumns,string[] whereColumns); Task<int> UpdateByTempAsync(string tableName,string tempName,string [] updateColumns,string[] whereColumns);
Task<int> ExecuteBulkCopyAsync(DataTable dt); Task<int> ExecuteBulkCopyAsync(DataTable dt);
Task CreateTempAsync<T>(DataTable dt) where T : class, new(); Task CreateTempAsync<T>(DataTable dt) where T : class, new();
void CloseDb();
} }
} }

View File

@@ -8,7 +8,7 @@ namespace SqlSugar
public interface IFastest<T> public interface IFastest<T>
{ {
IFastest<T> AS(string tableName); IFastest<T> AS(string tableName);
IFastest<T> PageSize(int Size);
int BulkCopy(List<T> datas); int BulkCopy(List<T> datas);
Task<int> BulkCopyAsync(List<T> datas); Task<int> BulkCopyAsync(List<T> datas);

View File

@@ -52,9 +52,12 @@ namespace SqlSugar
} }
catch (Exception ex) catch (Exception ex)
{ {
base.CloseDb();
throw ex; throw ex;
} }
finally
{
base.CloseDb();
}
return await Task.FromResult(dt.Rows.Count); return await Task.FromResult(dt.Rows.Count);
} }