public ActionResult Create(QuestionEditViewModel viewModel) { if (viewModel.Upsert()) { return(RedirectToAction("Index")); } return(View(viewModel)); }
public ActionResult Edit(int id, QuestionEditViewModel viewModel) { return(ViewOr404(viewModel, () => { if (viewModel.Upsert(true)) { return RedirectToAction("Index"); } return View(viewModel); })); }