[release/10.0] Fix TableSharingConcurrencyTokenConvention to skip JSON-mapped entities #37286
+56
−0
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 #37274
Description
The
TableSharingConcurrencyTokenConventionwas incorrectly adding shadow concurrency token properties to JSON-mapped owned entities causing model validation to fail.Customer impact
Apps using TPH inheritance with a concurrency token in the base class and a JSON-mapped owned entity in a derived class get an exception during model building. There is no known workaround other than removing either the concurrency token or the JSON mapping.
How found
Customer reported on EF 10. Not a common scenario.
Regression
Yes, from EF Core 9.x.
Testing
Test added.
Risk
Low. Targeted fix for the affected scenario.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.