Пример #1
0
 public ActionResult Create(QuestionEditViewModel viewModel)
 {
     if (viewModel.Upsert())
     {
         return(RedirectToAction("Index"));
     }
     return(View(viewModel));
 }
Пример #2
0
 public ActionResult Edit(int id, QuestionEditViewModel viewModel)
 {
     return(ViewOr404(viewModel, () =>
     {
         if (viewModel.Upsert(true))
         {
             return RedirectToAction("Index");
         }
         return View(viewModel);
     }));
 }