views:

246

answers:

1

I would like to implement a Hierarchy Type Inheritance ... i.e. Cars to BMWs ... Cars would have CarTypeID that is associated with CarTypes. I would like CarTypeID to be the discriminator column. Unfortunately, I cannot do this in ADO.NET Entity Framework.

If I would like to keep the association, how am I able to achieve this?

Has anyone come up with a work around?

+1  A: 

You can't do this. You must use a different column, as the column which is a constrained FK end and the inheritance discriminator column cannot be the same.

I'm of mixed minds as to whether this is a bad thing or not. I think inheritance is often overused, especially in O/R modeling. If you already have a FK to car type info...

Craig Stuntz

related questions