Skip to content

Conversation

AndriySvyryd
Copy link
Member

Add support for property bag complex types
Throw for shadow properties on complex types

Fixes #31237

cc @artl93

@AndriySvyryd AndriySvyryd requested a review from a team as a code owner August 1, 2025 18:14
Copy link

@Copilot 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 introduces the IStructuralProperty interface to unify complex properties and navigation properties under a common abstraction. The purpose is to simplify handling of properties that reference types (both complex types and entity types) throughout the EF Core codebase.

  • Introduces new interface hierarchy for structural properties
  • Consolidates handling of navigation and complex properties
  • Adds validation to prevent shadow properties on complex types

Reviewed Changes

Copilot reviewed 33 out of 34 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
IStructuralProperty.cs Introduces new interface for properties that reference types
IReadOnlyStructuralProperty.cs Read-only version of structural property interface
IMutableStructuralProperty.cs Mutable version for model building
IConventionStructuralProperty.cs Convention-based version for model building
CollectionResultExpression.cs Updates to use IStructuralProperty instead of IPropertyBase
ModelValidator.cs Adds validation to prevent shadow properties on complex types
Various test files Adds tests for new functionality and skips failing tests
Files not reviewed (1)
  • src/EFCore/Properties/CoreStrings.Designer.cs: Language not supported

@AndriySvyryd AndriySvyryd force-pushed the Issue31237_Refactor2 branch from f912b4f to 3c55c01 Compare August 1, 2025 19:42
@AndriySvyryd AndriySvyryd force-pushed the Issue31237_Refactor2 branch from 7ac6b9e to 352443c Compare August 6, 2025 01:21
Throw for shadow properties on complex types
Throw for concurrency tokens mapped to JSON
Throw for invalid JSON column type
Throw for JSON complex properties nested in non-JSON properties

Fixes #31237
Fixes #35934
@AndriySvyryd AndriySvyryd enabled auto-merge (squash) August 12, 2025 17:59
@AndriySvyryd AndriySvyryd merged commit 29a8c97 into main Aug 12, 2025
7 checks passed
@AndriySvyryd AndriySvyryd deleted the Issue31237_Refactor2 branch August 12, 2025 18:40
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.

Complex type collection support
2 participants