Skip to content

Commit 13c6383

Browse files
committed
- 修复 MySql Enum MapType(int) 表达式值解析 bug;
1 parent 7e4d81f commit 13c6383

File tree

2 files changed

+112
-1
lines changed

2 files changed

+112
-1
lines changed

FreeSql/FreeSql.xml

Lines changed: 109 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FreeSql/Internal/CommonExpression.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,8 +1136,10 @@ public string ExpressionLambdaToSql(Expression exp, ExpTSC tsc)
11361136
return conditionalSql;
11371137
}
11381138
case ExpressionType.Call:
1139-
if (!tsc.isNotSetMapColumnTmp) tsc.mapType = null;
11401139
var exp3 = exp as MethodCallExpression;
1140+
if (exp3.CanDynamicInvoke() && tsc.mapType != null || tsc.mapTypeTmp != null || tsc.mapColumnTmp != null)
1141+
return formatSql(Expression.Lambda(exp3).Compile().DynamicInvoke(), tsc.mapType, tsc.mapColumnTmp, tsc.dbParams);
1142+
if (!tsc.isNotSetMapColumnTmp) tsc.mapType = null;
11411143
if (exp3.IsExpressionCall())
11421144
{
11431145
//SqlExt.In 替换成 Array.Contains 解析,可避免 MapType 问题

0 commit comments

Comments
 (0)