public async Task <IActionResult> PutJogo([FromRoute] int id, [FromBody] Jogo jogo) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (await _context.Jogos.AnyAsync(x => x.Id == id)) { jogo.Id = id; _context.Attach(jogo).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); } return(NotFound()); }