public IActionResult SubmitEditOptionForm(AddPassageViewModel addPassageViewModel)
 {
     // controller code will go here
     if (ModelState.IsValid)
     {
         context.Entry(addPassageViewModel).State = EntityState.Modified;
         context.SaveChanges();
         return(Redirect("../adminpage"));
     }
     return(View("..homes/addoption", addPassageViewModel));
 }
        public IActionResult ProcessAddPassageForm(AddPassageViewModel addPassageViewModel)
        {
            if (ModelState.IsValid)
            {
                GameText newPassage = new GameText()
                {
                    StoryPassage = addPassageViewModel.StoryPassage,
                    Title        = addPassageViewModel.Title,
                    IsAWinner    = addPassageViewModel.IsAWinner,
                    IsALoser     = addPassageViewModel.IsALoser
                };

                context.GameText.Add(newPassage);
                context.SaveChanges();
                return(Redirect("../adminpage"));
            }
            return(View("../home/addpassage", addPassageViewModel));
        }
 public IActionResult Edit(AddPassageViewModel addPassageViewModel)
 {
     return(View(addPassageViewModel));
 }
        public IActionResult Add()
        {
            AddPassageViewModel addPassageViewModel = new AddPassageViewModel();

            return(View(addPassageViewModel));
        }