Closed dougwaldron closed 1 month ago
Good advice from the EF Core Inheritance docs:
In summary, TPH is usually fine for most applications, and is a good default for a wide range of scenarios, so don't add the complexity of TPC if you don't need it. Specifically, if your code will mostly query for entities of many types, such as writing queries against the base type, then lean towards TPH over TPC.
That being said, TPC is also a good mapping strategy to use when your code will mostly query for entities of a single leaf type and your benchmarks show an improvement compared with TPH.
Use TPT only if constrained to do so by external factors.
TPH benefits from sparse columns:
The Work Entries will need to implement entity type hierarchy mapping. Further reading: