获取某个角色下的所有用户:
var roleManager = new RoleManager(new RoleStore(context));
var role = await roleManager.FindByNameAsync("roleName");
var usersInRole = userManager.Users.Where(u => u.Roles.Any(r => r.RoleId == role.Id)).ToList();
获取某个用户所属的所有角色:
var user = await userManager.FindByIdAsync(userId);
var rolesOfUser = await userManager.GetRolesAsync(user.Id);