public AjaxResult EditProfiles([Bind(Include = "Id,Name")] IEnumerable <ProfileModel> profiles) { foreach (var profile in profiles) { if (!ModelState.IsValid) { return(new AjaxResult(AjaxResultState.Error)); } _profileManagementService.UpdateProfile(profile); } return(new AjaxResult(AjaxResultState.OK)); }
public IActionResult EditProfile(ProfileManagementModel profile) { try { // TODO: Add update logic here if (ModelState.IsValid) { _profileManagementService.UpdateProfile(profile); } return(RedirectToAction(nameof(Index))); } catch { return(RedirectToAction("EditProfile")); } }