How can I write this query in LINQ:
SELECT Name,
READY = max(CASE TrDet.tracktypeid WHEN 7 THEN 1 END),
AVAILABLE = max(CASE TrDet.tracktypeid WHEN 2 THEN 1 WHEN 5 THEN 1 END)
FROM PENDINGAPPROVAL Apr
JOIN TRACKS Tr ON Apr.TrackId = Tr.Id
JOIN TRACK_DETAIL TrDet ON Tr.Id = TrDet.TrackId
GROUP BY Tr.Name
Thanks
This doesn't answer the question you asked, but this gets the answer you want: