public ActionResult Edit(int id) { var judge = DP.GetJudgeById(id); var model = new JudgeEditionViewModel() { FirstName = judge.FirstName, LastName = judge.LastName, Bio = judge.Bio, Email = judge.Email }; return(View(model)); }
public void Edit(JudgeEditionViewModel model) { var judgeToEdit = GetJudgeById(model.Id); if (judgeToEdit != null) { judgeToEdit.FirstName = model.FirstName; judgeToEdit.LastName = model.LastName; judgeToEdit.Email = model.Email; judgeToEdit.Bio = model.Bio; _Context.SaveChanges(); } }
public ActionResult Edit(JudgeEditionViewModel model) { DP.Edit(model); return(RedirectToAction("Judges", "Admin")); }