Question

I have an abstract class I use as a base for a number of other classes.

Some of the derived classes have lots of extra properties, so I think I'm best off using Table per Type. But there's one derived type that doesn't have any extra properties.

But I'd like to keep it distinct from the base class for behavioral reasons.

How might I handle this in EF?

Était-ce utile?

La solution

The derived class' table would have a foreign key to the base table's record only (and possibly a PK field if the FK is not the PK), so the derived table would either be [BaseTableId] only or ( [DerivedTablePK], [BaseTableId] )

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top