public async Task <IActionResult> Edit(string userId) { // получаем пользователя var account = _userManagerService.GetUserById(userId); if (account != null) { // получем список ролей пользователя var userRoles = await _userManagerService.GetRolesByAccount(userId); var allRoles = _userManagerService.ShowListOfRoles(); ChangeRoleViewModel model = new ChangeRoleViewModel { UserId = account.Result.Id, UserEmail = account.Result.Email, UserRoles = userRoles, AllRoles = allRoles }; return(View(model)); } return(NotFound()); }