TPH Inheritance

Image

We’ve seen that split entities and TPT hierarchies are modelled in the same way in the database. The difference is semantic: Is this one entity that’s had its properties split, or is this two entities with shared properties? The same is true of Table-per-Hierarchy (TPH) inheritance and partitioned entities: Both are represented in the database schema as a single table, and the difference is semantic. TPH schemas do give you an extra clue, though. There will be at least one (and sometimes more than one) field in the schema that indicates what kind of entity a row represents:

On Your Own

There are three steps to creating the ...

Get Fluent Entity Framework now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.