From 841375617b8e29ef1c779157036cf4631e9f2976 Mon Sep 17 00:00:00 2001 From: 2881099 <2881099@qq.com> Date: Thu, 29 Jun 2023 16:11:53 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BC=98=E5=8C=96=20=E8=A1=A8=E8=BE=BE?= =?UTF-8?q?=E5=BC=8F=E8=A7=A3=E6=9E=90=E5=86=85=E5=AD=98=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E5=80=BC=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FreeSql/Internal/CommonExpression.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FreeSql/Internal/CommonExpression.cs b/FreeSql/Internal/CommonExpression.cs index eff9ee4b..e1ec23d5 100644 --- a/FreeSql/Internal/CommonExpression.cs +++ b/FreeSql/Internal/CommonExpression.cs @@ -1018,6 +1018,8 @@ namespace FreeSql.Internal return conditionalSql; } case ExpressionType.Call: + //提前直接解析 内存表达式 + if (exp.IsParameter() == false) return formatSql(Expression.Lambda(exp).Compile().DynamicInvoke(), tsc.mapType, tsc.mapColumnTmp, tsc.dbParams); tsc.mapType = null; var exp3 = exp as MethodCallExpression; if (exp3.Object == null && ( @@ -1699,7 +1701,6 @@ namespace FreeSql.Internal } other3Exp = ExpressionLambdaToSqlOther(exp3, tsc); if (string.IsNullOrEmpty(other3Exp) == false) return other3Exp; - if (exp3.IsParameter() == false) return formatSql(Expression.Lambda(exp3).Compile().DynamicInvoke(), tsc.mapType, tsc.mapColumnTmp, tsc.dbParams); if (exp3.Method.DeclaringType == typeof(Enumerable)) throw new Exception(CoreStrings.Not_Implemented_Expression_UseAsSelect(exp3, exp3.Method.Name, (exp3.Arguments.Count > 1 ? "..." : ""))); throw new Exception(CoreStrings.Not_Implemented_Expression(exp3)); case ExpressionType.Parameter: