I have a "User" entity, I also have another entity called "ClientUser" which inherits from User.
I am trying to write a query that gets me all users that dont have an inheriting ClientUser. However joining ClientUser onto User appears to freak out the fragile linq provider.
I'm running this:
var list = from c in meta.User
join cu in meta.ClientUser on c.UserId equals cu.UserId into tempCU
from contacts in tempCU.DefaultIfEmpty()
select c;
if (canLogin != null)
list = list.Where(p => p.CanLogon == canLogin.Value);
(canLogin did not equal null)
I get:
The multi-part identifier "LPLA_1.UserId" could not be bound.<br>The multi-part identifier "LPLA_1.ClientId" could not be bound.<br>The multi-part identifier "LPLA_1.SecondaryEmail" could not be bound.<br>The multi-part identifier "LPLA_1.Title" could not be bound.<br>The multi-part identifier "LPLA_1.Notes" could not be bound.<br>The multi-part identifier "LPLA_1.IsMainContact" could not be bound.
The fields it's mentioning there are from ClientUser.
So I would add another line like: where contacts == null to filter out those users... but I'm not getting that far.
(ClientUser is properly configured as a subclass of User in the llbl designer)