-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Fix primitive/complex collection handling on subtypes #37482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request fixes issue #37478 by adding support for primitive and complex collection handling on derived types in inheritance hierarchies. The core change refactors the TryExpandRelationship method to properly handle both entity and complex types when binding collection properties.
Changes:
- Refactored
NavigationExpandingExpressionVisitorto use a switch expression for cleaner type handling and to properly bind primitive/complex collections on subtypes - Added
Intsprimitive collection property to theCoketest model (a derived type) - Added comprehensive test coverage for the new functionality across all inheritance strategies (TPH, TPT, TPC)
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
NavigationExpandingExpressionVisitor.ExpressionVisitors.cs |
Refactored TryExpandRelationship to use switch expression and moved collection binding logic after type-specific handling |
Coke.cs |
Added Ints primitive collection property to test derived type collection handling; fixed typo in existing comment |
InheritanceData.cs |
Added test data for the new Ints property |
InheritanceQueryTestBase.cs |
Added new test method Primitive_collection_on_subtype |
InheritanceQueryFixtureBase.cs |
Added assertion for the new Ints property |
TPH/TPT/TPCInheritanceQuerySqlServerTest.cs |
Added SQL Server-specific test implementations with expected SQL baselines |
TPH/TPT/TPCInheritanceTableSplittingQuerySqlServerTest.cs |
Updated SQL baselines to include Ints column |
TPH/TPT/TPCInheritanceJsonQuerySqlServerTest.cs |
Updated JSON-based SQL baselines to include Ints column |
IncompleteMappingInheritanceQuerySqlServerTest.cs |
Added test implementation for incomplete mapping scenario |
InheritanceQueryCosmosTest.cs |
Added Cosmos DB-specific test implementation |
src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.ExpressionVisitors.cs
Outdated
Show resolved
Hide resolved
….ExpressionVisitors.cs Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.
Fixes #37478