public async Task <IActionResult> PutPedidoVendaLinhas([FromRoute] int id, [FromBody] PedidoVendaLinhas pedidoVendaLinhas) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != pedidoVendaLinhas.Id) { return(BadRequest()); } _context.Entry(pedidoVendaLinhas).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PedidoVendaLinhasExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutItem([FromRoute] int id, [FromBody] Item item) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != item.Id) { return(BadRequest()); } _context.Entry(item).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ItemExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }