public async Task <IActionResult> Edit(int id, [Bind("GameLibraryID,Name,Description,GameSystemID,Rating,DiscType")] GameLibrary gameLibrary) { if (id != gameLibrary.GameLibraryID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(gameLibrary); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GameLibraryExists(gameLibrary.GameLibraryID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["GameSystemID"] = new SelectList(_context.GameSystems, "GameSystemID", "SystemName", gameLibrary.GameSystemID); return(View(gameLibrary)); }
public async Task <IActionResult> Edit(int id, [Bind("GameSystemID,SystemName")] GameSystem gameSystem) { if (id != gameSystem.GameSystemID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(gameSystem); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GameSystemExists(gameSystem.GameSystemID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(gameSystem)); }