Skip to content

Commit 5c2afbb

Browse files
authored
Apply fix from #34729 to Cosmos SqlExpressionFactory to keep it in sync (#34964)
1 parent 6cacf97 commit 5c2afbb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/EFCore.Cosmos/Query/Internal/SqlExpressionFactory.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private SqlExpression ApplyTypeMappingOnSqlBinary(
156156
case ExpressionType.Coalesce:
157157
{
158158
inferredTypeMapping = typeMapping ?? ExpressionExtensions.InferTypeMapping(left, right);
159-
resultType = inferredTypeMapping?.ClrType ?? left.Type;
159+
resultType = inferredTypeMapping?.ClrType ?? (left.Type != typeof(object) ? left.Type : right.Type);
160160
resultTypeMapping = inferredTypeMapping;
161161
break;
162162
}

0 commit comments

Comments
 (0)