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:-
var billData =
from billtotal in context.billTotals
join billcard in context.billClubcards
on billtotal.OrderId equals billcard.OrderId
join billtender in context.billTenders
on billtotal.OrderId equals billtender.OrderId
select billtotal;
If you're wondering why, it's because the query syntax is just syntactic sugar for the underlying extension method:-
context.billTotals
.Join(
context.billClubcards,
billtotal => billtotal.OrderId,
billclubcard => billclubcard.OrderId,
(billtotal, billclubcard) => billtotal)
.Join(
context.billTenders,
billtotal => billtotal.OrderId,
billtender => billtender.OrderId,
(billtotal, billtender) => billtotal);
Your original implementation would expand to:-
context.billTotals
.Join(
context.billClubcards,
billtotal => billtotal.OrderId,
billclubcard => billclubcard.OrderId,
(billtotal, billclubcard) => billtotal)
.Join(
context.billTenders,
billtotal => billtender.OrderId, // billtender isn't in scope!
billtender => billtotal.OrderId, // billtotal isn't in scope!
(billtotal, billtender) => billtotal);