I have the following query in TSQL
select * from users
inner join linkUserPhoneNumber on users.UserId = linkUserPhoneNumber.UserId
INNER JOIN PhoneNumber ON PhoneNumber.PhoneNumberId =
linkUserPhoneNumber.PhoneNumberId
where UserName = 'superuser' and password ='password'
I have the following query in Entity Framework
var query = (from u in myEntities.Users
join link in myEntities.linkUserPhoneNumbers on u.UserId equals link.UserId
join p in myEntities.PhoneNumbers on p.PhoneNumberId equals link.PhoneNumberId
where u.UserName == Username && u.Password == Password
select u).ToList();
When I try to compile it, I get
Error 3 The name 'p' is not in scope on the left side of 'equals'. Consider swapping the expressions on either side of 'equals'.
Error 4 The name 'link' is not in scope on the right side of 'equals'. Consider swapping the expressions on either side of 'equals'.