I'm new to EF and Linq and wondering what's the best and simplest way to query 3 relational tables with one being a many-to-many.
Say I have the following Tables:
- Roles (Role_CID, Role)
2. Users (User_CID, Username)
3. Xref (Role_CID, User_CID)
and I want to return all of the roles for user 'Joe'. With t-Sql I could simply:
select Role from Roles r inner join XRef x on x.Role_CID = r.Role_CID inner join User u on u.User_CID = x.User_CID where u.Username = 'Joe'
What's the best way to return the list of Roles?