[RC2] - Fixes to complex values types#36617
Merged
roji merged 2 commits intodotnet:release/10.0from Aug 20, 2025
Merged
Conversation
Part of dotnet#31376 and dotnet#36296 Continues dotnet#36557
There was a problem hiding this comment.
Pull Request Overview
This PR fixes several complex value types scenarios in Entity Framework Core 10, specifically addressing issues with JSON nullable complex types and Nullable operations. The fixes enable proper translation of Nullable<T>.HasValue and Value for both JSON and table-splitting scenarios.
Key changes:
- Moved nullable member translation logic from dedicated translator to main SQL translating visitor
- Fixed JSON projection handling for nullable value complex types
- Enhanced test coverage for complex value types scenarios
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| RelationalSqlTranslatingExpressionVisitor.cs | Added direct handling of Nullable members (HasValue/Value) in VisitMember method |
| RelationalSqlTranslatingExpressionVisitor.StructuralEquality.cs | Fixed JSON scalar type handling to unwrap nullable types |
| RelationalShapedQueryCompilingExpressionVisitor.ShaperProcessingExpressionVisitor.cs | Enhanced CreateJsonShapers to handle nullable value types with proper CLR type parameter |
| RelationalMemberTranslatorProvider.cs | Removed registration of NullableMemberTranslator |
| NullableMemberTranslator.cs | Deleted dedicated nullable member translator class |
| RelationalProjectionBindingExpressionVisitor.cs | Added type nullability handling for structural type projections |
| RelationalStructuralTypeShaperExpression.cs | Changed return types for MakeClrTypeNullable/NonNullable methods |
| Test files | Added comprehensive test coverage for nullable value type scenarios |
src/EFCore.Relational/Query/RelationalSqlTranslatingExpressionVisitor.cs
Outdated
Show resolved
Hide resolved
artl93
approved these changes
Aug 20, 2025
AndriySvyryd
approved these changes
Aug 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #31376 and #36296
Continues #36557
Description
This fixes several mainstream scenarios with complex values types, one of EF 10's major new features:
Nullable<T>.HasValueandValue(including for non-JSON table-splitting, /cc @cincuranet)Customer impact
Queries involving the above query scenarios fail.
How found
Smoke-testing and increasing test coverage.
Regression
No.
Testing
Tests added.
Risk
Low - this mainly touches code that's new in 10 anyway (around complex types).