コード例 #1
0
        public async Task <ActionResult> UserToRole(string rolename, string userId, bool?ischecked)
        {
            if (ischecked.HasValue && ischecked.Value)
            {
                await _userService.AddUserToRole(userId, rolename);
            }
            else
            {
                await _userService.RemoveUserToRole(userId, rolename);
            }

            return(RedirectToAction("Index"));
        }