質問

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?

役に立ちましたか?

解決

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] )

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top