public ActionResult Edit(CreateEditUserViewModel user) { user.UserDetails.Roles = _userModel.GetRoles(user.SelectedRoles).ToList(); if (!ModelState.IsValid) { return(View(user)); } _userModel.Update(user.UserDetails); return(RedirectToAction("Details", new { userId = user.UserDetails.User.Id })); }