Another post for self reference, this time, how to map inheritance strategies with Entity Framework Code First.
Single Table Inheritance / Table Per Class Hierarchy
First, the default strategy: one table for all classes in the hierarchy. Will store all columns on the same table, so all properties on derived classes must be nullable, and there will be lots of nulls. An additional column will be created, which will contain a discriminator value for deciding which type corresponds to each row.
Class Table Inheritance / Table Per Type
This will map all properties of the base class into a table of its own and each derived class in its own table, connected to the base table by a foreign key. No duplication will occur and properties on derived classes can be mapped as not nullable.
Concrete Table Inheritance / Table Per Concrete Type
No table for the base class, each concrete class will have its own table, which will contain columns for all of the class’ properties, including inherited ones. One record will only exist in one of the tables, so usage of IDENTITY columns as primary keys is not possible, because there will be records with the same ID on all of the tables, unless different seeds and/or increments are used.
This will require additional configuration at the context level, this strategy is not possible just with attributes: