public ActionResult Edit([Bind(Include = "Id,Name,Phone")] InterviewerVM interviewerVM) { if (ModelState.IsValid) { InterviewerDTO interviewerDTO = Mapper.Map <InterviewerDTO>(interviewerVM); InterviewerService.Update(interviewerDTO); return(RedirectToAction("Index")); } return(View(interviewerVM)); }
public string Update(int id, string name, string description) { string msg; try { Interviewer model = service.GetById(id); model.Name = name; model.Description = description; model.ChangedBy = User.Identity.GetUserId(); service.Update(model); msg = "Saved Successfully"; } catch (Exception ex) { msg = "Error occured:" + ex.Message; } return(msg); }