mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 01:58:13 +08:00
Update core
This commit is contained in:
@@ -39,8 +39,8 @@ namespace SqlSugar
|
||||
public virtual async Task CreateTempAsync<T>(DataTable dt) where T : class, new()
|
||||
{
|
||||
await this.Context.UnionAll(
|
||||
this.Context.Queryable<T>().Where(it => false).AS(dt.TableName),
|
||||
this.Context.Queryable<T>().Where(it => false).AS(dt.TableName)).Select("top 1 * into #temp").ToListAsync();
|
||||
this.Context.Queryable<T>().Select("*").Where(it => false).AS(dt.TableName),
|
||||
this.Context.Queryable<T>().Select("*").Where(it => false).AS(dt.TableName)).Select("top 1 * into #temp").ToListAsync();
|
||||
dt.TableName = "#temp";
|
||||
}
|
||||
}
|
||||
|
@@ -80,7 +80,7 @@ namespace SqlSugar
|
||||
private async Task<int> _BulkUpdate(List<T> datas, string[] whereColumns, string[] updateColumns)
|
||||
{
|
||||
Begin(datas);
|
||||
Check.Exception(whereColumns == null || whereColumns.Count() == 0, "where columns count=0");
|
||||
Check.Exception(whereColumns == null || whereColumns.Count() == 0, "where columns count=0 or need primary key");
|
||||
Check.Exception(updateColumns == null || updateColumns.Count() == 0, "set columns count=0");
|
||||
var isAuto = this.context.CurrentConnectionConfig.IsAutoCloseConnection;
|
||||
this.context.CurrentConnectionConfig.IsAutoCloseConnection = false;
|
||||
|
@@ -59,6 +59,14 @@ namespace SqlSugar
|
||||
{
|
||||
return Convert.ToInt64(value);
|
||||
}
|
||||
else if (type.IsIn(UtilConstants.IntType,UtilConstants.LongType,UtilConstants.ShortType))
|
||||
{
|
||||
return value;
|
||||
}
|
||||
else if (type==UtilConstants.GuidType)
|
||||
{
|
||||
return "'" + value.ToString() + "'";
|
||||
}
|
||||
else if (type == UtilConstants.ByteArrayType)
|
||||
{
|
||||
string bytesString = "0x" + BitConverter.ToString((byte[])value).Replace("-", "");
|
||||
|
@@ -44,6 +44,7 @@ namespace SqlSugar
|
||||
{
|
||||
this.Context.Ado.Connection.Open();
|
||||
}
|
||||
copy.BulkCopyTimeout = this.Context.Ado.CommandTimeOut;
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user