I think the answer should be easy, but I’m just struggling:
Would like to have data from 2 tables in a LINQ query similar to:
from f in Faults
join af in AvailabilityFaults on f.FaultID equals af.FaultID
join a in Availabilities on new { af.CalendarDay, af.CircuitNumber}
equals new { a.CalendarDay, a.CircuitNumber}
join e in ExternalImportAvailabilities on new { a.CalendarDay, a.CircuitNumber }
equals new { e.CalendarDay, e.CircuitNumber }
where a.CalendarDay.Value.Day != 1
group f by f.FaultID into groupF
select new {groupF, e.CalendarDay}
The problem here comes in that it can’t find e.CalendarDay in the select clause.
I also tried things like: CalendarDay= e.Max(e=>e.CalendarDay), but e is not in the current context.
How can I add data from table ‘e’ in the select clause?
If I understood you properly, this is what you are looking for: