Skip to content

Commit c47bd07

Browse files
rojiCopilot
andcommitted
Use JSON type for JSON null expressions
Keep generated JSON null expressions typed with the JSON type mapping CLR type instead of object, so COALESCE and JSON setter expressions stay well-typed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 00d4b5a commit c47bd07

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/EFCore.PG/Query/Internal/NpgsqlQueryableMethodTranslatingExpressionVisitor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,7 @@ private SqlExpression JsonNull(RelationalTypeMapping jsonTypeMapping)
14441444
=> new SqlUnaryExpression(
14451445
ExpressionType.Convert,
14461446
_sqlExpressionFactory.Constant("null"),
1447-
typeof(object),
1447+
jsonTypeMapping.ClrType,
14481448
jsonTypeMapping);
14491449

14501450
private SqlExpression CoalesceToJsonNull(SqlExpression value, RelationalTypeMapping jsonTypeMapping)

0 commit comments

Comments
 (0)