public IActionResult ChangeRole(ChangeRoleUserViewModel changeRoleModel) { if (User.Identity.Name != changeRoleModel.UserEmail) { _userService.ChangeRole(changeRoleModel.UserEmail, changeRoleModel.Roles); } return(RedirectToAction(nameof(ManageUsers))); }
public IActionResult ChangeRole(string userEmail) { var roleNames = _userService.GetRoleNames(); var changeRoleViewModel = new ChangeRoleUserViewModel { Roles = roleNames.ToList(), UserEmail = userEmail }; return(View(changeRoleViewModel)); }