How does Entity Framework manage relationships in a model that uses mixed inheritance strategies (e.g., TPH with TPT)?

  • By creating a separate table for each class and using foreign keys to establish relationships between them
  • By creating a single table for the base class and separate tables for each derived class
  • By creating a table for each class and duplicating columns from the base class in each derived class
  • By creating separate tables for each class in the hierarchy
Entity Framework manages relationships in a mixed inheritance strategy like TPH with TPT by creating a single table for the base class and separate tables for each derived class. This ensures that the shared properties from the base class are stored only once, avoiding redundancy. Relationships are established using foreign keys, linking the derived class tables to the base class table. This approach allows for efficient querying and navigation of the object graph.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *