public new ActionResult Profile() { var model = new ProfileModel(); model.InjectFrom<UnflatLoopValueInjection>(UserProfile.Current); return View(model); }
public new ActionResult Profile(ProfileModel model) { if (ModelState.IsValid) { UserProfile.Current.InjectFrom<UnflatLoopValueInjection>(model); try { var result = _userService.SaveOrUpdate(UserProfile.Current); if (ModelState.Process(result)) { TempData.AddSuccessMessage("User was successfully updated."); return RedirectToAction("Profile"); } } catch (Exception) { ModelState.AddModelError("Exception", "Unexpected error"); } } return View(model); }