Skip to content

Conversation

@ajcvickers
Copy link
Contributor

Fixes #32411
Port of #32560

Description

The issue here is that when a value converter is applied to a principal property, then that converter is used by the dependent properties unless something else is explicitly configured. However, this meant that when the PK has a converter but the FK does not, then the FK can get configured as a primitive collection, since it doesn't have a converter preventing this. The fix is to add a convention that sets the element type for dependent properties to match that for principal properties.

Customer impact

Exception when trying to use a custom enumerable converter with a PK and FK when it is not explicitly specified on the FK.

How found

Customer report on 8.0.

Regression

Yes.

Testing

Tests added.

Risk

Low and quirked.

…t type as principal properties (#32560)

* Ensure that, by convention, dependent properties have the same element type as principal properties

Fixes #32411

The issue here is that when a value converter is applied to a principal property, then that converter is used by the dependent properties unless something else is explicitly configured. However, this meant that when the PK has a converter but the FK does not, then the FK can get configured as a primitive collection, since it doesn't have a converter preventing this.

The fix is to add a convention that sets the element type for dependent properties to match that for principal properties.

* Update based on review
@ajcvickers ajcvickers requested a review from a team December 10, 2023 17:15
@ajcvickers ajcvickers added this to the 8.0.x milestone Dec 10, 2023
@ajcvickers ajcvickers modified the milestones: 8.0.x, 8.0.2 Dec 12, 2023
@wtgodbe wtgodbe merged commit 5b1c02e into release/8.0 Jan 3, 2024
@wtgodbe wtgodbe deleted the 231208_NothingInTheBag branch January 3, 2024 22:34
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.

4 participants