(RC2) Persist Id
values into owned collection JSON documents
#34478
+475
−267
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.
Ports #34466 to 9.0
Fixes #29380
Description
Persisting entity types with an
Id
property did not work in previous releases of EF Core. This was an adoption blocker for many, as can be seen by the GitHub votes. This change is a targeted fix for 9 that allowsId
properties to be persisted. It is too risky for 9 to do the wider fix of allowing key properties to be persisted.Customer impact
Fixes a major adoption blocker for use of JSON in relational databases.
How found
Many customer reports
Regression
No
Testing
Id
property added to existing model used by hundreds of tests.Risk
Medium. This changes the model built, which we have discussed and analyzed and we think it's okay, especially since the model that was being built before was not valid. However, the model is used everywhere and it could have some impact that we have missed.