- 修复 IIF 三元表达式树解析 bool HasValue 问题;

This commit is contained in:
2881099
2022-06-13 19:00:09 +08:00
parent d55ddf4cf8
commit 4549bf446c
2 changed files with 4 additions and 1 deletions

View File

@ -691,7 +691,7 @@ namespace FreeSql.Internal
}
}
}
if (leftExp.Type.NullableTypeOrThis() == typeof(bool) && (leftExp.NodeType != ExpressionType.MemberAccess && rightExp.NodeType != ExpressionType.MemberAccess))
if (leftExp.Type.NullableTypeOrThis() == typeof(bool) && (left.EndsWith(" IS NOT NULL") || left.EndsWith(" IS NULL") || leftExp.NodeType != ExpressionType.MemberAccess && rightExp.NodeType != ExpressionType.MemberAccess))
{
var leftExpCall = leftExp as MethodCallExpression;
if (leftExpCall == null || !(leftExpCall.Method.DeclaringType == typeof(SqlExt) && leftExpCall.Method.Name == nameof(SqlExt.IsNull)))