public ActionResult Create(EditMeetingModel model) { if (ModelState.IsValid) { var meeting = new Meeting(); model.MapTo(meeting); repository.Add(meeting); repository.SaveAllChanges(); return RedirectToAction("Index"); } return View(model); }
public ActionResult Edit(int id, EditMeetingModel model) { if (ModelState.IsValid) { var meeting = GetMeeting(id); model.MapTo(meeting); repository.SaveAllChanges(); return RedirectToAction("Index"); } return View(model); }