Make NULL a variant in the case the type is an enum. This is in addition to when it is a numeric type

pull/204/head
Christopher Jolly 2 years ago
parent 3f6cc90f8f
commit dcca36386c

@ -568,7 +568,7 @@ namespace EntityFrameworkCore.Jet.Query.Sql.Internal
}
parent.TryPeek(out var exp);
if (sqlConstantExpression.Value is null && exp is ProjectionExpression && (sqlConstantExpression.Type.IsNumeric() || sqlConstantExpression.Type == typeof(bool)))
if (sqlConstantExpression.Value is null && exp is ProjectionExpression && (sqlConstantExpression.Type.IsNumeric() || sqlConstantExpression.Type.IsEnum || sqlConstantExpression.Type == typeof(bool)))
{
Sql.Append("CVar(");
Sql.Append(sqlConstantExpression.TypeMapping!.GenerateSqlLiteral(sqlConstantExpression.Value));

Loading…
Cancel
Save