public IActionResult EditOption(OptionViewModel viewModel) { if (ModelState.IsValid) { if (viewModel.Option.QuestOpt_Id == 0) { _repository.AddOption(viewModel.Option); } else { _repository.UpdateOption(viewModel.Option); } return(RedirectToAction("Index", "Quest")); } viewModel.Quests = listItems; return(View(viewModel)); }