public IActionResult RemoveUsers(string id) { var usersWithRole = _userManager.GetUsersInRoleAsync(id).Result.ToList(); var model = new AddToRoleVM { users = usersWithRole, RoleName = id }; return(View(model)); }
public IActionResult AddUsers(string id) { var usersWithRole = _userManager.GetUsersInRoleAsync(id).Result.ToList(); var usersWithoutRole = _userManager.Users.Where(b => !usersWithRole.Contains(b)).ToList(); var model = new AddToRoleVM { users = usersWithoutRole, RoleName = id }; return(View(model)); }