What is Table-per-Hierarchy (TPH) inheritance in Entity Framework?
- Each type in the inheritance hierarchy is mapped to a separate file in the project.
- Each type in the inheritance hierarchy is mapped to a single table in the database.
- Each type in the inheritance hierarchy is mapped to its own schema in the database.
- Each type in the inheritance hierarchy is mapped to its own table in the database.
Table-per-Hierarchy (TPH) inheritance in Entity Framework maps all derived types in an inheritance hierarchy to a single database table. This means all properties of the derived types are stored in one table, and a discriminator column is used to differentiate between the types. This approach is useful when the derived types share most of their properties and have only a few unique properties. It simplifies the database schema but may lead to null values in the table for properties that are specific to certain derived types.
Loading...
Related Quiz
- Discuss the impact of lazy loading in Entity Framework within a distributed system context.
- In a multi-layered architecture, Entity Framework is typically used within the ________ layer to interact with the database.
- Which Entity Framework approach involves designing the database schema in a visual designer before generating the code?
- In a multi-layered architecture, how does Entity Framework handle data consistency across different layers?
- When dealing with enum types, LINQ to Entities requires explicit ________ to match the database's data type.