EntityFramework, Inherited Classes without Discriminator

c# entity-framework entity-framework-6

Popular Answer

It is impossible to differentiate between your entities if you don't have a discriminator or table for each class.

In fact, if your domain model doesn't need bool properties, you may ignore them as Entity Framework by default maps inheritance using Table per Hierarchy. You'll get a discriminator column created for you automatically. A truck object will populate the discriminator column appropriately if you add it to your DbSet.

http://weblogs.asp.net/manavi/inheritance-mapping-strategies-with-entity-framework-code-first-ctp5-part-1-table-per-hierarchy-tph

2
8/18/2016 3:07:16 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow