public async Task <IActionResult> ViewUserDetails(int custId, string userId) { var user = await _userManager.FindByIdAsync(userId); var roles = await _userManager.GetRolesAsync(user); var model = new SetUserRolesViewModel() { Customer = _context.Kunds.SingleOrDefault(x => x.KundId == custId), User = user, CurrentRole = roles.FirstOrDefault() }; return(PartialView("_ViewUserDetailsPartial", model)); }
public async Task <IActionResult> SetUserRoles([FromBody] SetUserRolesViewModel model) { await userService.SetRoles(model.UserId, model.Roles); return(new OkResult()); }