public async Task <IActionResult> Edit(int id, [Bind("Id,TSMGameStatusId,GameDateTime,GameLength,WeekDay,GameNumber,Round,HomeTeam,AwayTeam,Arena,Series,HD1,HD2,LD1,LD2")] Game20192020 game20192020) { if (id != game20192020.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(game20192020); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Game20192020Exists(game20192020.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["TSMGameStatusId"] = new SelectList(_context.TSMGameStatus, "Id", "TSMGameStatusName", game20192020.TSMGameStatusId); return(View(game20192020)); }
public async Task <IActionResult> Create([Bind("Id,TSMGameStatusId,GameDateTime,GameLength,WeekDay,GameNumber,Round,HomeTeam,AwayTeam,Arena,Series,HD1,HD2,LD1,LD2")] Game20192020 game20192020) { if (ModelState.IsValid) { _context.Add(game20192020); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["TSMGameStatusId"] = new SelectList(_context.TSMGameStatus, "Id", "TSMGameStatusName", game20192020.TSMGameStatusId); return(View(game20192020)); }