コード例 #1
0
        public IActionResult ChangeRole(ChangeRoleUserViewModel changeRoleModel)
        {
            if (User.Identity.Name != changeRoleModel.UserEmail)
            {
                _userService.ChangeRole(changeRoleModel.UserEmail, changeRoleModel.Roles);
            }

            return(RedirectToAction(nameof(ManageUsers)));
        }
コード例 #2
0
        public IActionResult ChangeRole(string userEmail)
        {
            var roleNames           = _userService.GetRoleNames();
            var changeRoleViewModel = new ChangeRoleUserViewModel
            {
                Roles     = roleNames.ToList(),
                UserEmail = userEmail
            };

            return(View(changeRoleViewModel));
        }