i am trying to join 3 tables using EF but it throws an error saying
consider swaping conditions on either side of equals
can some one pls help
var billdata = from billtotal in context.billTotals
join billcard in context.billClubcards
on billtotal.OrderID equals billcard.OrderID
join billtender in context.billTenders
on billtender.OrderID equals billtotal.OrderID
select billtotal;
The compiler error is quite correct:-
The name 'billtender' is not in scope on the left side of 'equals'. Consider swapping the expressions on either side of 'equals'.The table you’re joining from needs to be on the left, the one you’re joining onto needs to be on the right. Hence:-
If you’re wondering why, it’s because the query syntax is just syntactic sugar for the underlying extension method:-
Your original implementation would expand to:-