-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Description
See
- https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-8.0/whatsnew#value-objects-using-complex-types
- Add complex types to Metadata efcore#31003
- Only discover complex types when configured through pre-convention model configuration or annotation efcore#31399
- Fix saving null complex properties with nested required complex properties and other cleanup efcore#36472
- Add support for complex type discriminator. efcore#35744
- Add support for optional complex types to model building efcore#35614
- Implement optional complex types efcore#36502
- Add model building support for complex type collections efcore#35905
- Add change tracking support for complex collections efcore#35962
- Add complex collection support to PropertyValues efcore#36366
- Allow configuring the column type with ToJson() efcore#36478
- Complex JSON query support efcore#36355
Compare with owned types (#4265):
Owned types:
- Have identity
- Can only be mapped to a refence type
- Are mutable, can have navigations
- Can be mapped to different tables
- Can be mapped as optional with table sharing
Complex types:
- No identity, single instance can be referenced from different entities
- Can be mapped to a reference or value type
- Recommended to be immutable (especially for value types)
- Need to be mapped to the same table (with the exception of entity splitting). Collections need to be mapped to JSON in relational databases
- Can be mapped as optional with table sharing, but only if it has at least one required property