change your lomodel to join all three tables. then, you will need one foreach only.


try something like this:

from client_uo in userobjects
join client_obj in objects on client_uo.objectid == client_obj.objectid
join p in problems on p.objectid == clt_obj.objectid
join pu in problemusers on p.problemid == pu.problemid
join assignee in users on pu.userid == assignee.userid
where client_obj.userid == clientuserid

that should produce a multi join that gets you from clientuserid to client-userobjects to problemobjects to problems to problemusers (assignees?) to users, with all the data available at one go. you may want to group it together, either by object, by problem, or by assigned user, depending on the display you're trying to produce.

Related Query

More Query from same tag