I am stuck trying to get this output
Id | Name | Role ---------------------------- 1 | John | Administrator ---------------------------- 2 | Mary | Manag
This will help you
using(ApplicationDbContext db=new ApplicationDbContext()) { var users = (from user in db.Users from roles in user.Roles join role in db.Roles on roles.RoleId equals role.Id select new { user.UserName, role.Name }).ToList(); }