Support inheritance for owned/property bag/shared-type entity types
For example, this from #9536: ```C# public class Friend { public int Id { get; set; } public string Name { get; set; } public FullAddress Address { get; set; } } public class LessThanFriend { public int Id { get; set; } public string Name { get; set; } public CityAddress Address { get; set; } } public class CityAddress { public string Cap { get; set; } public string City { get; set; } } public class FullAddress : CityAddress { public string Street { get; set; } } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity<Friend>().OwnsOne(e => e.Address); modelBuilder.Entity<LessThanFriend>().OwnsOne(e => e.Address); } ``` This is ambiguous as to whether LessThanFriend.CityAddress should be mapped to allow inheritance such that either a CityAddress or a FullAddress could be persisted. Typically, we only map inheritance when both types are in the model. However, having both types in the model as Owned types on different entities perhaps does not have the same semantics--especially when thinking of them like complex types. Based on triage discussion from #9536, we think we want to support both the simple mapping (just persisting given concrete type, which is what the request on #9536 is for) and the inheritance mapping, which would require, for TPH, and additional discriminator column in the table. We did not come to a final decision on which should be the default, or what the new API will look li
Posted by ajcvickers on Aug 30, 2017, 8:52 PM
Tags
Related issues
- some bike vendor told me that the biggest problem with regular to ebike conversion was that regular bike frames were not strong enough to...
- I think of this as the kiosk economy.
- What a goofy comment.
- There's lots of evidence for positive influences of Caffeine on the body (some negative as well), especially the brain.
- Compose support in WSLc
- [RFC] Roadmap to v2.0
Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments
support (Other)
some bike vendor told me that the biggest problem with regular to ebike conversion was that regular bike frames were not strong enough to...
I think of this as the kiosk economy.
What a goofy comment.
There's lots of evidence for positive influences of Caffeine on the body (some negative as well), especially the brain.
Compose support in WSLc
[RFC] Roadmap to v2.0
[Feature]: Add TurboQuant Support for KV Cache Quantization
Support for AGENTS.md and .agents/skills/, the community has been asking since August 2025
Support inheritance for owned/property bag/shared-type entity types
For example, this from #9536: ```C# public class Friend { public int Id { get; set; } public string Name { get; set; } public FullAddress Address { get; set; } } public class LessThanFriend { public int Id { get; set; } public string Name { get; set; } public CityAddress Address { get; set; } } public class CityAddress { public string Cap { get; set; } public string City { get; set; } } public class FullAddress : CityAddress { public string Street { get; set; } } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity<Friend>().OwnsOne(e => e.Address); modelBuilder.Entity<LessThanFriend>().OwnsOne(e => e.Address); } ``` This is ambiguous as to whether LessThanFriend.CityAddress should be mapped to allow inheritance such that either a CityAddress or a FullAddress could be persisted. Typically, we only map inheritance when both types are in the model. However, having both types in the model as Owned types on different entities perhaps does not have the same semantics--especially when thinking of them like complex types. Based on triage discussion from #9536, we think we want to support both the simple mapping (just persisting given concrete type, which is what the request on #9536 is for) and the inheritance mapping, which would require, for TPH, and additional discriminator column in the table. We did not come to a final decision on which should be the default, or what the new API will look li
Comments (0)
No comments yet. Start the discussion.