I have the following database tables:
Table1: User
UserId
Username
Table2: Role
RoleId
Rolename
Table3: UserRole
UserId
RoleId
A User can have many Roles and a Role can have many Users.
When I model this with EF, I get a User entity with a list of UserRole entities. What I want is a User with a list of Role entities.
Is there a way to model this or query via LINQ to return a User entity and the Role entities they belong to?
Thanks
Dirk