Skip to content

Simpler null constant checks in Cosmos translator#37616

Merged
roji merged 1 commit into
dotnet:mainfrom
ShadyNagy:patch-1
Feb 3, 2026
Merged

Simpler null constant checks in Cosmos translator#37616
roji merged 1 commit into
dotnet:mainfrom
ShadyNagy:patch-1

Conversation

@ShadyNagy
Copy link
Copy Markdown
Contributor

This PR simplifies internal null-constant checks in the Cosmos query expression visitor by inlining pattern matching instead of using a small private helper method. The behavior is preserved while slightly reducing indirection.

Changes

  • In CosmosSqlTranslatingExpressionVisitor, inline the IsNullSqlConstantExpression helper logic into the entity-equality rewrite path and delete the now-unneeded private helper.
File Description
src/EFCore.Cosmos/Query/Internal/CosmosSqlTranslatingExpressionVisitor.cs Inlines null-constant detection for entity-equality rewrites using is SqlConstantExpression { Value: null } pattern matching and removes the redundant private helper.

@ShadyNagy ShadyNagy requested a review from a team as a code owner February 2, 2026 23:12
@ShadyNagy ShadyNagy changed the title Inline IsNullSqlConstantExpression in CosmosSqlTranslatingExpressionVisitor Simpler null constant checks in Cosmos translator Feb 2, 2026
@roji roji merged commit cd82f73 into dotnet:main Feb 3, 2026
8 of 10 checks passed
@ShadyNagy ShadyNagy deleted the patch-1 branch February 3, 2026 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants