public async Task <IActionResult> Edit(int id, [Bind("videoGameID,videoGameDescription")] VideoGameDetails videoGameDetails) { if (id != videoGameDetails.videoGameID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(videoGameDetails); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VideoGameDetailsExists(videoGameDetails.videoGameID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(videoGameDetails)); }
public async Task <IActionResult> Create([Bind("videoGameID,videoGameDescription")] VideoGameDetails videoGameDetails) { if (ModelState.IsValid) { _context.Add(videoGameDetails); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(videoGameDetails)); }