public ActionResult Create(Actor newActor) { if (ModelState.IsValid) { _repository.Save(newActor); return RedirectToAction("Index"); } else { return View(newActor); } }
public ActionResult Edit(Actor model) { try { Actor actor = _repository.FindById(model.ID); UpdateModel(actor); _repository.Save(actor); return RedirectToAction("Details", new { id = model.ID }); } catch (Exception) { ModelState.AddModelError("", "Edit Failure, see inner exception"); } return View(model); }