public async Task <IActionResult> PutGame([FromRoute] int id, [FromBody] Game game) { if (id != game.GameId) { return(BadRequest()); } _context.Entry(game).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (_context.Games.Find(id) == null) { return(NotFound()); } throw; } return(NoContent()); }