public async Task <IActionResult> Create([Bind("GameSystemID,SystemName")] GameSystem gameSystem) { if (ModelState.IsValid) { _context.Add(gameSystem); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(gameSystem)); }
public async Task <IActionResult> Create([Bind("GameLibraryID,Name,Description,GameSystemID,Rating,DiscType")] GameLibrary gameLibrary) { if (ModelState.IsValid) { _context.Add(gameLibrary); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["GameSystemID"] = new SelectList(_context.GameSystems, "GameSystemID", "SystemName", gameLibrary.GameSystemID); return(View(gameLibrary)); }