Skip to content

Conversation

@roji
Copy link
Member

@roji roji commented Jan 11, 2026

Fixes #37478

@roji roji marked this pull request as ready for review January 11, 2026 11:07
@roji roji requested a review from a team as a code owner January 11, 2026 11:07
Copilot AI review requested due to automatic review settings January 11, 2026 11:07
Copy link

Copilot AI left a 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 NavigationExpandingExpressionVisitor to use a switch expression for cleaner type handling and to properly bind primitive/complex collections on subtypes
  • Added Ints primitive collection property to the Coke test 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

Copilot AI review requested due to automatic review settings January 11, 2026 11:58
Copy link

Copilot AI left a 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.

@roji roji merged commit d358209 into dotnet:main Jan 13, 2026
12 of 13 checks passed
@roji roji deleted the 37478 branch January 13, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can no longer translate operators over primitive collections or complex types on inheritance subtypes

2 participants