From 061edc3de2857fe274860d318a4b677ac6d95759 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Wed, 19 Jul 2023 19:08:42 +0800 Subject: [PATCH] Update exp to sql --- .../ResolveItems/MemberExpressionResolve.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MemberExpressionResolve.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MemberExpressionResolve.cs index 555792b3c..508abea56 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MemberExpressionResolve.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MemberExpressionResolve.cs @@ -658,6 +658,16 @@ namespace SqlSugar private static bool IsDateDiff(MemberExpression expression) { + if (expression.Expression != null && + expression.Expression is BinaryExpression) + { + var binExp = (expression.Expression as BinaryExpression); + var nodeType= binExp.NodeType; + if (nodeType == ExpressionType.Subtract&& binExp.Left.Type==UtilConstants.DateType && binExp.Right.Type == UtilConstants.DateType) + { + return true; + } + } return expression.Expression!=null&& expression.Expression is BinaryExpression &&