Skip to content

Commit 8657055

Browse files
rojiCopilot
andcommitted
Fix JSON null type mapping on hotfix
Assign a string type mapping to the JSON null literal operand before casting it to the JSON mapping, avoiding EF10 type-mapping postprocessor failures in ExecuteUpdate JSON tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 78e671c commit 8657055

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
@@ -1443,7 +1443,7 @@ protected override bool TrySerializeScalarToJson(
14431443
private SqlExpression JsonNull(RelationalTypeMapping jsonTypeMapping)
14441444
=> new SqlUnaryExpression(
14451445
ExpressionType.Convert,
1446-
_sqlExpressionFactory.Constant("null"),
1446+
_sqlExpressionFactory.Constant("null", _typeMappingSource.FindMapping(typeof(string))),
14471447
jsonTypeMapping.ClrType,
14481448
jsonTypeMapping);
14491449

0 commit comments

Comments
 (0)