mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-03 12:18:00 +08:00
Synchronization code
This commit is contained in:
parent
a507562689
commit
3c5e4fbcf4
@ -751,7 +751,11 @@ namespace SqlSugar
|
||||
}
|
||||
private void ThrowUpdateByExpressionByMesage(string message)
|
||||
{
|
||||
Check.Exception(UpdateParameterIsNull == true, ErrorMessage.GetThrowMessage(" no support "+ message, "根据对像更新 db.Updateabe(对象) 禁止使用 SetColumns和Where ,你可以使用 "+ message + "。 更新分为2种方式 1.根据表达式更新 2.根据实体或者集合更新 , 具体用法请查看文档 "));
|
||||
Check.Exception(UpdateParameterIsNull == true, ErrorMessage.GetThrowMessage(" no support "+ message, "根据表达式更新 db.Updateable<T>()禁止使用 " + message+"。 更新分为2种方式 1.根据表达式更新 2.根据实体或者集合更新 , 具体用法请查看文档 "));
|
||||
}
|
||||
private void ThrowUpdateByObjectByMesage(string message)
|
||||
{
|
||||
Check.Exception(UpdateParameterIsNull == false, ErrorMessage.GetThrowMessage(" no support " + message, "根据对象更新 db.Updateable(对象)禁止使用 " + message + "。 更新分为2种方式 1.根据表达式更新 2.根据实体或者集合更新 , 具体用法请查看文档 "));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -902,6 +902,16 @@ namespace SqlSugar
|
||||
result.Where(sql.Key, sql.Value);
|
||||
return result;
|
||||
}
|
||||
|
||||
public IUpdateable<T> In(object[] ids)
|
||||
{
|
||||
ThrowUpdateByObjectByMesage(" In(object[] ids) ");
|
||||
List<IConditionalModel> conditionalModels = new List<IConditionalModel>();
|
||||
var column = this.EntityInfo.Columns.FirstOrDefault(it => it.IsPrimarykey);
|
||||
Check.ExceptionEasy(column == null, "In need primary key", "In需要实体有主键");
|
||||
conditionalModels.Add(new ConditionalModel() { FieldName= column.DbColumnName, ConditionalType= ConditionalType.In,FieldValue=string.Join(",",ids),CSharpTypeName=column.UnderType?.Name } );
|
||||
return this.Where(conditionalModels);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user