// GET: Profile/Create public ActionResult Create() { var profile = new ProfileCreateEditViewModel { Categories = CategoryService.Lookup() }; return(View(profile)); }
public ActionResult Edit(ProfileCreateEditViewModel model) { if (!ModelState.IsValid) { model.Categories = CategoryService.Lookup(); return(View(model)); } try { // TODO: Add update logic here ProfileService.Update(Mapper.Map <ProfileServiceModel>(model)); return(RedirectToAction("Index")); } catch { return(View()); } }