public async Task <IActionResult> CreateSalesOrderDetail_inmem([FromBody] Sales.SalesOrderDetail_inmem value) { _db.Sales_SalesOrderDetail_inmem.Add(value); await _db.SaveChangesAsync(); return(Ok(value)); }
public async Task <IActionResult> EditSalesOrderDetail_inmem(long salesOrderDetailID, int salesOrderID, [FromBody] Sales.SalesOrderDetail_inmem value) { var existing = await _db.Sales_SalesOrderDetail_inmem.FirstOrDefaultAsync(x => x.SalesOrderDetailID == salesOrderDetailID && x.SalesOrderID == salesOrderID); if (existing == null) { return(NotFound()); } existing.SalesOrderID = value.SalesOrderID; existing.SalesOrderDetailID = value.SalesOrderDetailID; existing.CarrierTrackingNumber = value.CarrierTrackingNumber; existing.OrderQty = value.OrderQty; existing.ProductID = value.ProductID; existing.SpecialOfferID = value.SpecialOfferID; existing.UnitPrice = value.UnitPrice; existing.UnitPriceDiscount = value.UnitPriceDiscount; existing.ModifiedDate = value.ModifiedDate; _db.Sales_SalesOrderDetail_inmem.Update(existing); await _db.SaveChangesAsync(); return(NoContent()); }