mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Synchronization code
This commit is contained in:
parent
02533af0ee
commit
63e9863df7
@ -51,7 +51,20 @@ namespace SqlSugar
|
||||
public async virtual Task<int> Merge<T>(string tableName,DataTable dt, EntityInfo entityInfo, string[] whereColumns, string[] updateColumns, List<T> datas) where T : class, new()
|
||||
{
|
||||
var result = 0;
|
||||
await this.Context.Utilities.PageEachAsync(datas,2000,async pageItems =>
|
||||
var pageSize = 2000;
|
||||
if (dt.Columns.Count > 100)
|
||||
{
|
||||
pageSize = 100;
|
||||
}
|
||||
else if (dt.Columns.Count > 50)
|
||||
{
|
||||
pageSize = 300;
|
||||
}
|
||||
else if (dt.Columns.Count > 30)
|
||||
{
|
||||
pageSize = 500;
|
||||
}
|
||||
await this.Context.Utilities.PageEachAsync(datas, pageSize, async pageItems =>
|
||||
{
|
||||
var x = await this.Context.Storageable(pageItems).As(tableName).WhereColumns(whereColumns).ToStorageAsync();
|
||||
result += await x.BulkCopyAsync();
|
||||
|
@ -80,8 +80,8 @@ namespace SqlSugar
|
||||
}
|
||||
public QueryMethodInfo AddJoinInfo(Type joinEntityType, string shortName, string onWhere, JoinType type = JoinType.Left)
|
||||
{
|
||||
var method = QueryableObj.GetType().GetMyMethod("AddJoinInfo", 4, typeof(string), typeof(string), typeof(string), typeof(JoinType));
|
||||
this.QueryableObj = method.Invoke(QueryableObj, new object[] { this.Context.EntityMaintenance.GetTableName(joinEntityType), shortName, onWhere, type });
|
||||
var method = QueryableObj.GetType().GetMyMethod("AddJoinInfo", 4, typeof(Type), typeof(string), typeof(string), typeof(JoinType));
|
||||
this.QueryableObj = method.Invoke(QueryableObj, new object[] { joinEntityType, shortName, onWhere, type });
|
||||
return this;
|
||||
}
|
||||
public QueryMethodInfo GroupBy(List<GroupByModel> models)
|
||||
|
Loading…
Reference in New Issue
Block a user