This was covered in another post but I would like some verification because I won't be able to use EF if what I've read is correct.
I'm having a problem getting table per type inheritance to work. I'm using a textbook example like the following where an employee "is" a person:
person, Columns: person_id (PK)(IDENTITY), name
employee: Columns: person_id (PK), department
The above works fine, however, most of my subtype tables are like this instead:
employee, Columns: employee_id (PK)(IDENTITY), person_id (FK), department
When I try to generate a model using the later table structure, I get:
Error 1 Error 3025: Problem in Mapping Fragment starting at line 60: Must specify mapping for all key properties (employee.employee_id) of table employee.
C:\Documents and Settings\joel\My Documents\Visual Studio 2008\Projects\Person\Person\PersonModel.edmx 61 15 Person
A previous poster said the base-subtype tables must be related PK-PK. Ours would be PK-FK.
One of the main reasons I want to use EF over Linq to SQL is because EF handles this inheritance. That would greatly simplify our coding. Are there any workarounds? When will this be fixed/improved?
Joel