I have four tables:
Applications
- ApplicationID
- Name
Roles
- RoleID
- ApplicationID
- Name
Users
- UserID
- Name
UserRoles
- UserID
- RoleID
I'm trying to get applications by UserID but I can't figure out a
simple LINQ statement to do so. Can anybody help me? Basically, we
need to get the UserRoles by UserID, then get the roles from that,
then get the applications from that.
This gets the UserRoles:
var UserRoles = DataContext.Users.Single(u =u.UserID ==
UserID).UserRoles;
How do I get the apps?
var apps = DataContext.Applications.Where(a =a.Roles ...?)