Пример #1
0
 public ActionResult Create(SectionViewModel sectionvm)
 {
     if (ModelState.IsValid)
     {
         sectionRepository.Add(sectionvm.ToOrm());
         return(RedirectToRoute(new { controller = "Section", Action = "Index" }));
     }
     return(View(sectionvm));
 }
Пример #2
0
 public ActionResult Edit(SectionViewModel section)
 {
     if (ModelState.IsValid)
     {
         sectionRepository.Update(section.ToOrm());
         return(RedirectToAction("Index"));
     }
     return(View(section));
 }