public ActionResult Edit(LeadSourceViewModel leadSource) { if (ModelState.IsValid) { var entity = Mapper.Map <LeadSource>(leadSource); leadSourceService.Update(entity); return(RedirectToAction("Index")); } return(View(leadSource)); }
// GET: LeadSources/Edit/5 public ActionResult Edit(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LeadSourceViewModel leadSource = Mapper.Map <LeadSourceViewModel>(leadSourceService.Get(id.Value)); if (leadSource == null) { return(HttpNotFound()); } return(View(leadSource)); }