reproduced. adventure works, individual is subtype of customer
var q = from i in metaData.Individual
select new
{
i.Contact.LastName,
i.SalesTerritory.Name
};
It's problematic, as the relations added to the set of relations for the query require inheritance relations (to form the sub-supertype tree) as well, and it likely goes wrong there. Looking into it.
(edit) the relationships in the collection are:
Individual - Contact
Customer - SalesTerritory (as salesterritory is inherited from customer by individual, like yours)
This ordering doesn't add 'customer' to the list of elements to join even though it's a supertype of individual, so the 'customer' coming in in relationship 2 fails.
You see the effect when you flip the projection:
var q = from i in metaData.Individual
select new
{
i.SalesTerritory.Name,
i.Contact.LastName
};
works. Looking into why this is not taking into account supertypes/subtypes in the other situation.
Hopefully it goes smoother than yesterday where we found the cause and spot of the issue around 3PM but fixed it at 7PM as all attempts to change it failed somewhere in a test.