Update Updateable

This commit is contained in:
sunkaixuna
2021-08-26 14:29:58 +08:00
parent a5340a83cc
commit e91eb23279
2 changed files with 6 additions and 2 deletions

View File

@@ -32,6 +32,7 @@ namespace SqlSugar
public List<string> PrimaryKeys { get; set; }
public bool IsOffIdentity { get; set; }
public bool IsWhereColumns { get; set; }
public bool? IsListUpdate { get; set; }
public virtual string SqlTemplate
{
@@ -112,6 +113,7 @@ namespace SqlSugar
}
}
public virtual ExpressionResult GetExpressionValue(Expression expression, ResolveExpressType resolveType, bool isMapping = true)
{
ILambdaExpressions resolveExpress = this.LambdaExpressions;
@@ -156,7 +158,7 @@ namespace SqlSugar
}
var groupList = DbColumnInfoList.GroupBy(it => it.TableId).ToList();
var isSingle = groupList.Count() == 1;
if (isSingle)
if (isSingle&&this.IsListUpdate==null)
{
return ToSingleSqlString(groupList);
}

View File

@@ -684,7 +684,9 @@ namespace SqlSugar
{
UpdateObjs = new List<T>();
}
return Updateable(UpdateObjs.ToArray());
var result= (UpdateableProvider<T>)Updateable(UpdateObjs.ToArray());
result.UpdateBuilder.IsListUpdate = true;
return result;
}
public virtual IUpdateable<T> Updateable<T>(T UpdateObj) where T : class, new()
{