public async Task <IActionResult> Update(VideoGame g) { if (ModelState.IsValid) { await VideoGameDb.UpdateGame(g, _context); return(RedirectToAction("Index")); } return(View(g)); }
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)); }
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)); }