I have written a LINQ lambda query which so far which returns all staff which do not have an associated training row which works fine. I now need to amend my where clause to use
Inner joins are performed with the Join method. I think your query should go something like this:
var query = db.staff
.GroupJoin(db.training,
s => s.id,
t => t.staff_id,
(s, t) => new { Staff = s, Training = t.FirstOrDefault() })
.Join(db.manager,
gj => gj.Staff.manager_id,
m => m.id,
(gj, m) => new { Staff = gj.Staff, Training = gj.Training, Manager = m })
.Where(st => st.Training == null
&& st.Manager.id == managerId);