Synchronization code

This commit is contained in:
sunkaixuan 2024-05-14 11:39:20 +08:00
parent 006b336a7b
commit a12ca13d73
2 changed files with 8 additions and 2 deletions

View File

@ -250,8 +250,11 @@ namespace SqlSugar
return this;
}
public IDeleteable<T> WhereIF(bool isWhere, Expression<Func<T, bool>> expression)
{
if (DeleteBuilder.WhereInfos.Any() != true)
{
Check.ExceptionEasy(!StaticConfig.EnableAllWhereIF, "Need to program startup configuration StaticConfig. EnableAllWhereIF = true; Tip: This operation is very risky if there are no conditions it is easy to update the entire table", " 需要程序启动时配置StaticConfig.EnableAllWhereIF=true; 提示:该操作存在很大的风险如果没有条件很容易将整个表全部更新");
}
if (isWhere)
{
return Where(expression);

View File

@ -897,8 +897,11 @@ namespace SqlSugar
return this;
}
public IUpdateable<T> WhereIF(bool isWhere, Expression<Func<T, bool>> expression)
{
if (UpdateBuilder.WhereValues.Any() != true)
{
Check.ExceptionEasy(!StaticConfig.EnableAllWhereIF, "Need to program startup configuration StaticConfig. EnableAllWhereIF = true; Tip: This operation is very risky if there are no conditions it is easy to update the entire table", " 需要程序启动时配置StaticConfig.EnableAllWhereIF=true; 提示:该操作存在很大的风险如果没有条件很容易将整个表全部更新");
}
if (isWhere)
{
return Where(expression);