Bug BulkCopyUpdate

This commit is contained in:
sunkaixuan
2022-10-27 13:11:08 +08:00
parent c1ea1a825c
commit 0c04cf634a
2 changed files with 4 additions and 4 deletions

View File

@@ -41,8 +41,8 @@ namespace SqlSugar
public virtual async Task CreateTempAsync<T>(DataTable dt) where T : class, new() public virtual async Task CreateTempAsync<T>(DataTable dt) where T : class, new()
{ {
await this.Context.UnionAll( await this.Context.UnionAll(
this.Context.Queryable<T>().Select("*").Where(it => false).AS(dt.TableName), this.Context.Queryable<T>().Filter(null,true).Select("*").Where(it => false).AS(dt.TableName),
this.Context.Queryable<T>().Select("*").Where(it => false).AS(dt.TableName)).Select("top 1 * into #temp").ToListAsync(); this.Context.Queryable<T>().Filter(null, true).Select("*").Where(it => false).AS(dt.TableName)).Select("top 1 * into #temp").ToListAsync();
dt.TableName = "#temp"; dt.TableName = "#temp";
} }
} }

View File

@@ -41,8 +41,8 @@ namespace SqlSugar
public virtual async Task CreateTempAsync<T>(DataTable dt) where T : class, new() public virtual async Task CreateTempAsync<T>(DataTable dt) where T : class, new()
{ {
await this.Context.UnionAll( await this.Context.UnionAll(
this.Context.Queryable<T>().Select("*").Where(it => false).AS(dt.TableName), this.Context.Queryable<T>().Filter(null,true).Select("*").Where(it => false).AS(dt.TableName),
this.Context.Queryable<T>().Select("*").Where(it => false).AS(dt.TableName)).Select("top 1 * into #temp").ToListAsync(); this.Context.Queryable<T>().Filter(null, true).Select("*").Where(it => false).AS(dt.TableName)).Select("top 1 * into #temp").ToListAsync();
dt.TableName = "#temp"; dt.TableName = "#temp";
} }
} }