Kannadasan G
How many types of inheritance are supported by Entity Framework?
By Kannadasan G in Entity Framework on Mar 07 2019
  • Laxmidhar Sahoo
    Jan, 2020 2

    **Table per Hierarchy (TPH):

    This approach suggests one table for the entire class inheritance hierarchy. The table includes a discriminator column which distinguishes between inheritance classes. This is a default inheritance mapping strategy in Entity Framework.

    Table per Type (TPT):

    This approach suggests a separate table for each domain class.

    Table per Concrete Class (TPC):

    This approach suggests one table for one concrete class, but not for the abstract class. So, if you inherit the abstract class in multiple concrete classes, then the properties of the abstract class will be part of each table of the concrete class.

    Core supporting inheritance :

    mappers there are a few patterns how a class hierarchy can be mapped to a relational database. The most popular ones are the Table-Per-Hierarchy (TPH) and the Table-Per-Type (TPT) patterns. The Entity Framework Core 2.x (EF Core) officially supports the Table-per-Hierarchy pattern only

    • 0
  • Kannadasan G
    Mar, 2019 7

    Entity Framework supports three types of inheritances 1. Table-per-Hierarchy (TPH) 2. Table-per-Concrete-Type (TPC) 3. Table-per-Type (TPT)

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS