I want to get all users with their roles grouped by their name, and also include users that don't have any role.
I am using asp.net identity 2 so far i have tried
from user in users
from identityUserRole in user.Roles
join identityRole in identityRole on identityUserRole.RoleId equals identityRole.Id into r
from roles in r
group roles.Name by user.UserName into g
select new
{
UserName = g.Key,
Roles = g.ToList()
};
But this return only users that have role..