public ActionResult Create(SectionViewModel sectionvm) { if (ModelState.IsValid) { sectionRepository.Add(sectionvm.ToOrm()); return(RedirectToRoute(new { controller = "Section", Action = "Index" })); } return(View(sectionvm)); }
public ActionResult Edit(SectionViewModel section) { if (ModelState.IsValid) { sectionRepository.Update(section.ToOrm()); return(RedirectToAction("Index")); } return(View(section)); }