Link to home
Start Free TrialLog in
Avatar of ToString1
ToString1

asked on

linq to sql check for role in many to many relationship

I am not using membership provider

I have 3 tables

User, Role, UserRole

User -            UserID, Name
Role -             RoleID, RoleName
UserRole -     UserID, RoleID

I have 3 roles
Admin, TeamAdmin, User

In linq to sql I am getting the logged in user and now need to check if they are in roles and then assign a bool to say which role they are in

bool IsUserAdmin
bool IsUserTeamAdmin
bool User

What is the best way in linq to sql to get the user and check if they are in one or both roles?





 
ASKER CERTIFIED SOLUTION
Avatar of kumar754
kumar754
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial