mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Optimization constraint
This commit is contained in:
parent
910825781b
commit
006b336a7b
Src/Asp.NetCore2/SqlSugar/Abstract
@ -251,7 +251,10 @@ namespace SqlSugar
|
||||
}
|
||||
public IDeleteable<T> WhereIF(bool isWhere, Expression<Func<T, bool>> expression)
|
||||
{
|
||||
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 (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);
|
||||
|
@ -898,7 +898,10 @@ namespace SqlSugar
|
||||
}
|
||||
public IUpdateable<T> WhereIF(bool isWhere, Expression<Func<T, bool>> expression)
|
||||
{
|
||||
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 (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);
|
||||
|
Loading…
Reference in New Issue
Block a user