public async Task <IActionResult> PutPagamento([FromRoute] Guid id, [FromBody] Pagamento pagamento) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != pagamento.Id) { return(BadRequest()); } _context.Entry(pagamento).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PagamentoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutCategoriaFornecedores([FromRoute] Guid id, [FromBody] CategoriaFornecedores categoriaFornecedores) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != categoriaFornecedores.Id) { return(BadRequest()); } _context.Entry(categoriaFornecedores).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CategoriaFornecedoresExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }