There is 3 approach for creating tables base on classes which inherited from a base class and derived the base class and were gonna to indicate these ways and create sample for each of them.
By convention, EF will not automatically scan for base or derived types; this means that if you want a CLR type in your hierarchy to be mapped, you must explicitly specify that type on your model.
These solutions are dividing in 3 type
- Table-per-hierarchy (tph)
- Table-per-type (tpt)
- Table-per-concrete-type (tpc)
🔗 TPH
🔗 TPT
🔗 TPC