[Stack Overflow Issue 1](http://stackoverflow.com/q/13179634/1791547)
[Stack Overflow Issue 2](http://stackoverflow.com/q/10961690/1791547)
EF throws a configuration error when trying to map a Table Per Type model where the _Derived type contains a composite foreign key_ to another type, but one part of the _composite key is defined in the Base Type_ as a composite _primary key._
The main problem seems to be that EF does not see that TenantID is going to be in the derived table. And ordinarily it would be right, but in this case, TenantID is part of the key so will actually be in both tables.
This type of derived type mapping seems perfectly normal and it works perfectly fine without this composite key situation. So this seems like a bug.
Comments: **EF Team Triage:** This is part of a more fundamental limitation where EF doesn't support having a property defined in a base type and then using it as a foreign key in a derived type. Unfortunately this is a limitation that would be very hard to remove from our code base. Given that we haven't seen a lot of requests for it, it's not something we are planning to address at this stage so we are closing this issue.
[Stack Overflow Issue 2](http://stackoverflow.com/q/10961690/1791547)
EF throws a configuration error when trying to map a Table Per Type model where the _Derived type contains a composite foreign key_ to another type, but one part of the _composite key is defined in the Base Type_ as a composite _primary key._
The main problem seems to be that EF does not see that TenantID is going to be in the derived table. And ordinarily it would be right, but in this case, TenantID is part of the key so will actually be in both tables.
This type of derived type mapping seems perfectly normal and it works perfectly fine without this composite key situation. So this seems like a bug.
Comments: **EF Team Triage:** This is part of a more fundamental limitation where EF doesn't support having a property defined in a base type and then using it as a foreign key in a derived type. Unfortunately this is a limitation that would be very hard to remove from our code base. Given that we haven't seen a lot of requests for it, it's not something we are planning to address at this stage so we are closing this issue.