Skip to content

Conversation

@AndriySvyryd
Copy link
Member

We already are correctly throwing in validation for this scenario.

Fixes #35710

@artl93 Test-only change

@AndriySvyryd AndriySvyryd requested review from a team and Copilot August 26, 2025 23:48
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 a test case to verify that Entity Framework Core correctly validates and throws an exception when owned collections are mapped to the same table by default, which is not allowed. The test confirms existing validation behavior for issue #35710.

Key changes:

  • Added new test Owned_type_collections_are_mapped_to_same_tables_by_default() to verify proper validation
  • Made two test base classes abstract as they should not be instantiated directly
  • Removed an unrelated test that was likely moved elsewhere

Reviewed Changes

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

File Description
SqlServerModelBuilderTestBase.cs Added test for default owned collection mapping validation and removed unrelated test
PrecompiledSqlPregenerationQueryRelationalTestBase.cs Changed class from public to abstract
PrecompiledQueryRelationalTestBase.cs Changed class from public to abstract

@AndriySvyryd AndriySvyryd merged commit f5b97b5 into release/10.0 Aug 27, 2025
7 checks passed
@AndriySvyryd AndriySvyryd deleted the Issue35710 branch August 27, 2025 17:14
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.

By convention we generate ambiguous table name for some models with owned collections

2 participants