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 pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More Entity Framework interview questions

View all →