public async Task <IActionResult> PutPurchaseorderdetail([FromRoute] int id, [FromBody] Purchaseorderdetail purchaseorderdetail) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != purchaseorderdetail.PurchaseOrderDetailId) { return(BadRequest()); } _context.Entry(purchaseorderdetail).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PurchaseorderdetailExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutOrders([FromRoute] int id, [FromBody] Orders orders) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != orders.Id) { return(BadRequest()); } _context.Entry(orders).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrdersExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }