Пример #1
0
        public async Task <IActionResult> Update(VideoGame g)
        {
            if (ModelState.IsValid)
            {
                await VideoGameDb.UpdateGame(g, _context);

                return(RedirectToAction("Index"));
            }

            return(View(g));
        }
Пример #2
0
        public async Task <IActionResult> Update(VideoGame g)
        {
            if (ModelState.IsValid)
            {
                await VideoGameDb.UpdateGame(g, _context);

                return(RedirectToAction("Index"));
            }

            // If there are any errors, show the user the form again
            return(View(g));
        }
Пример #3
0
        public async Task <IActionResult> Update(VideoGame g)
        {
            if (ModelState.IsValid)
            {
                //If it works update the game
                await VideoGameDb.UpdateGame(g, _context);

                //redirect to index
                return(RedirectToAction("Index"));
            }
            //If any erorrs show user form again
            return(View(g));
        }