[release/8.0] Update FK ElementType when the FK properties change. #34561
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #33704
Description
In 8.0.0 we introduced a convention that configures properties as primitive collections, but it should avoid do that for properties that have been configured with a value conversion. However, in some cases a foreign key property can be configured as a primitive collection by the convention before the value conversion configuration is applied to the corresponding primary key. The solution is to enhance the convention logic to also handle this case.
Additionally, for Cosmos we were configuring properties as primitive collections even though they aren't supported.
Customer impact
Affected models fail in model validation with an unhelpful exception. There is a workaround, but it isn't straightforward.
How found
Customer reported
Regression
Yes, from 7.0.x
Testing
Tests added.
Risk
Low. Quirk added.