Property conversions are lost on base type is subtype is registered to model afterwards after upgrade to EFCore 8 #32430
Labels
area-model-building
area-primitive-collections
area-type-mapping
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
regression
Servicing-approved
type-bug
Milestone
File a bug
If you register a property converter on a type, and then register a subclass of that type, the property converter is lost. (At least for primitive collections, i have no tested complex types). Instead EF uses the new automatic json conversion available for collections of primitive types.
This used to work fine in EFCore 7.
This is currently breaking all existing data we have that was written to the database with EF 7 and below, which is quite bad. Unit tests did not catch this on our side when we upgraded as they always generate new data and ended up just using the default json converter.
Include your code
Db context:
Unit tests
Zip with entire project should be attached also
efwtf.zip
Include stack traces
I'm throwing the exceptions myself in the example code to make it clear that stuff has broken.
Include provider and version information
EF Core version:8.0.0
Database provider:Microsoft.EntityFrameworkCore.SqlServer
Target framework: net8.0
Operating system: Windows 10
IDE:
Additional information
Working model:
Broken model:
The text was updated successfully, but these errors were encountered: