mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-15 23:13:42 +08:00
Update core
This commit is contained in:
parent
dec730190a
commit
b9234bf5ed
@ -93,6 +93,7 @@ namespace SqlSugar
|
||||
var result = await buider.UpdateByTempAsync(GetTableName(), dt.TableName, updateColumns, whereColumns);
|
||||
this.context.DbMaintenance.DropTable(dt.TableName);
|
||||
this.context.CurrentConnectionConfig.IsAutoCloseConnection = isAuto;
|
||||
buider.CloseDb();
|
||||
End(datas);
|
||||
return result;
|
||||
}
|
||||
|
@ -13,5 +13,6 @@ namespace SqlSugar
|
||||
Task<int> UpdateByTempAsync(string tableName,string tempName,string [] updateColumns,string[] whereColumns);
|
||||
Task<int> ExecuteBulkCopyAsync(DataTable dt);
|
||||
Task CreateTempAsync<T>(DataTable dt) where T : class, new();
|
||||
void CloseDb();
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ namespace SqlSugar
|
||||
public interface IFastest<T>
|
||||
{
|
||||
IFastest<T> AS(string tableName);
|
||||
|
||||
IFastest<T> PageSize(int Size);
|
||||
int BulkCopy(List<T> datas);
|
||||
Task<int> BulkCopyAsync(List<T> datas);
|
||||
|
||||
|
@ -44,7 +44,7 @@ namespace SqlSugar
|
||||
try
|
||||
{
|
||||
var identityColumnInfo = this.entityInfo.Columns.FirstOrDefault(it => it.IsIdentity);
|
||||
if (identityColumnInfo!=null)
|
||||
if (identityColumnInfo != null)
|
||||
{
|
||||
throw new Exception("PgSql bulkcopy no support identity");
|
||||
}
|
||||
@ -52,9 +52,12 @@ namespace SqlSugar
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
base.CloseDb();
|
||||
throw ex;
|
||||
}
|
||||
finally
|
||||
{
|
||||
base.CloseDb();
|
||||
}
|
||||
return await Task.FromResult(dt.Rows.Count);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user