Ari Gamo
Ari Gamo

Reputation: 11

ADO.NET Entity Framework Hierarchy type Inheritance Error 3032 Workaround?

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?

Upvotes: 1

Views: 929

Answers (1)

Craig Stuntz
Craig Stuntz

Reputation: 126547

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...

Upvotes: 2

Related Questions