mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 18:34:55 +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()
|
public virtual async Task CreateTempAsync<T>(DataTable dt) where T : class, new()
|
||||||
{
|
{
|
||||||
await this.Context.UnionAll(
|
await this.Context.UnionAll(
|
||||||
this.Context.Queryable<T>().Where(it => false).AS(dt.TableName),
|
this.Context.Queryable<T>().Select("*").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)).Select("top 1 * into #temp").ToListAsync();
|
||||||
dt.TableName = "#temp";
|
dt.TableName = "#temp";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ namespace SqlSugar
|
|||||||
private async Task<int> _BulkUpdate(List<T> datas, string[] whereColumns, string[] updateColumns)
|
private async Task<int> _BulkUpdate(List<T> datas, string[] whereColumns, string[] updateColumns)
|
||||||
{
|
{
|
||||||
Begin(datas);
|
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");
|
Check.Exception(updateColumns == null || updateColumns.Count() == 0, "set columns count=0");
|
||||||
var isAuto = this.context.CurrentConnectionConfig.IsAutoCloseConnection;
|
var isAuto = this.context.CurrentConnectionConfig.IsAutoCloseConnection;
|
||||||
this.context.CurrentConnectionConfig.IsAutoCloseConnection = false;
|
this.context.CurrentConnectionConfig.IsAutoCloseConnection = false;
|
||||||
|
|||||||
@@ -59,6 +59,14 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
return Convert.ToInt64(value);
|
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)
|
else if (type == UtilConstants.ByteArrayType)
|
||||||
{
|
{
|
||||||
string bytesString = "0x" + BitConverter.ToString((byte[])value).Replace("-", "");
|
string bytesString = "0x" + BitConverter.ToString((byte[])value).Replace("-", "");
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
this.Context.Ado.Connection.Open();
|
this.Context.Ado.Connection.Open();
|
||||||
}
|
}
|
||||||
|
copy.BulkCopyTimeout = this.Context.Ado.CommandTimeOut;
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user