public async Task <IdentityResult> UpdateProfile(string userId, IUpdateProfileViewModel model) { var user = await _userManagerFacade.FindByIdAsync(userId); user.Name = model.Name; user.LastName = model.LastName; return(await _userManagerFacade.UpdateAsync(user)); }
public async Task <ActionResult> ChangeRole(UserRoleViewModel model) { var currentRole = _userManager.GetRole(model.UserId); if (currentRole != model.SelectedRole) { var currentUser = await _userManager.FindByIdAsync(model.UserId); await _userManager.RemoveFromRoleAsync(model.UserId, currentRole); await _userManager.AddToRoleAsync(model.UserId, model.SelectedRole); await _userManager.UpdateAsync(currentUser); } return(RedirectToAction("ManageUserRoles")); }
public IdentityResult Update(User entity) { return(_userManagerFacade.UpdateAsync(entity).Result); }