From d603994ac61ab42d160a51427a5fe811b914efaf Mon Sep 17 00:00:00 2001 From: sunkaixuna <610262374@qq.com> Date: Sat, 15 Jan 2022 17:33:47 +0800 Subject: [PATCH] Update exp to sql --- .../SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs | 2 +- .../SqlSugar/ExpressionsToSql/ResolveItems/BaseResolve.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs index a32862ff8..a525043f5 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs @@ -19,7 +19,7 @@ namespace SqlSugar public virtual string IsNullOrEmpty(MethodCallExpressionModel model) { var parameter = model.Args[0]; - return string.Format("( {0}='' OR {0} IS NULL )", parameter.MemberName); + return string.Format("( {0} IS NULL OR {0}='')", parameter.MemberName); } public virtual string HasValue(MethodCallExpressionModel model) diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/BaseResolve.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/BaseResolve.cs index 7bc091953..ee05afd98 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/BaseResolve.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/BaseResolve.cs @@ -483,7 +483,7 @@ namespace SqlSugar } } } - else if (item.Type == UtilConstants.BoolType && item is MethodCallExpression && (item as MethodCallExpression).Method.Name == "Any"&&IsSubMethod(item as MethodCallExpression)) + else if (item.Type == UtilConstants.BoolType && item is MethodCallExpression) { this.Expression = item; this.Start();