public async Task <IActionResult> PutCategoria(int id, Categoria categoria) { if (id != categoria.Id) { return(BadRequest()); } _context.Entry(categoria).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CategoriaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }