Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

EF Core TPT (Table-per-Type) generates foreign keys for both the base type and its derived types for referential integrity purposes. The foreign key on the base type ensures that any related records in the derived types refer to an existing record in the base type. The foreign key on the derived type ensures that the record in the derived type exists and refers to an existing record in the base type. This two-way foreign key relationship is necessary to ensure that the data is consistent and that referential integrity constraints are not violated.