seniorEntity Framework
How do you use Table-per-Hierarchy (TPH) vs Table-per-Type (TPT)?
Updated Apr 28, 2026
Short answer
They are inheritance mapping strategies. TPH maps an entire class hierarchy to a single table. TPT maps each class to its own table.
Deep explanation
TPH (Default): Fast querying, but requires a 'Discriminator' column and nullable columns for subclass properties. TPT: Cleaner schema (normalized), but queries require multiple JOINs which degrades performance. Configured in TPT by calling ToTable("TableName") on subclasses.
Unlock with a Pro subscription to view this section.
View pricingReal-world example
No real-world example available yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProCommon mistakes
No common mistakes listed yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProFollow-up questions
No follow-up questions available yet.
Unlock with a Pro subscription to view this section.
Upgrade to Pro