public ActionResult Create(EditTalkModel model) { if (ModelState.IsValid) { var talk = new Talk(); model.MapTo(talk); repository.Add(talk); repository.SaveAllChanges(); return RedirectToAction("Index"); } return View(model); }
public ActionResult Edit(int id, EditTalkModel model) { if (ModelState.IsValid) { var talk = GetTalk(id); model.MapTo(talk); repository.SaveAllChanges(); return RedirectToAction("Index"); } return View(model); }