Query:
- string[] roles =( from usr in dataBaseEntities.Users
- join uir in dataBaseEntities.UserInRoles
- on usr.UserId equals uir.UserId
- join rl in dataBaseEntities.Roles
- on uir.RoleId equals rl.RoleId
- where usr.UserId==user.UserId
- select new { rl.RoleName }). AsEnumerable().Select(x => string.Format("{0}", x.RoleName)).ToArray();
Output: It will give all the roles assigned to the Particular user based on usedId.


Swornatoya LenkaPosted Feb 17, 2015, 7:43 AM
Thank you very much it was very useful for me.. Pleas post this kind of articles. It is very helpful for beginners