Skip to content

Conversation

@roji
Copy link
Member

@roji roji commented Dec 14, 2025

Closes #34706

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 PR adds test coverage for querying complex types on entities that are mapped to both a table and a view, addressing issue #34706.

  • Adds a functional test that verifies complex types work correctly when an entity is mapped to both a database table and a view
  • Validates that EF Core properly queries from the view and materializes complex type properties

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/EFCore.Relational.Specification.Tests/Query/AdHocComplexTypeQueryRelationalTestBase.cs Adds the base test method Complex_type_on_an_entity_mapped_to_view_and_table with test context, model configuration, view creation, data seeding, and assertions
test/EFCore.SqlServer.FunctionalTests/Query/AdHocComplexTypeQuerySqlServerTest.cs Adds SQL Server-specific override that asserts the generated SQL queries the view correctly and selects complex type columns

@roji roji force-pushed the ComplexTypeWithView branch from d7e7314 to fe23b47 Compare January 5, 2026 22:19
@roji roji merged commit 2cc3da8 into dotnet:main Jan 6, 2026
7 of 8 checks passed
@roji roji deleted the ComplexTypeWithView branch January 6, 2026 01:16
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.

Error querying on complex type whose container is mapped to a table and a view

2 participants