public async Task <IActionResult> CreateSpecialOfferProduct_ondisk([FromBody] Sales.SpecialOfferProduct_ondisk value) { _db.Sales_SpecialOfferProduct_ondisk.Add(value); await _db.SaveChangesAsync(); return(Ok(value)); }
public async Task <IActionResult> EditSpecialOfferProduct_ondisk(int productID, int specialOfferID, [FromBody] Sales.SpecialOfferProduct_ondisk value) { var existing = await _db.Sales_SpecialOfferProduct_ondisk.FirstOrDefaultAsync(x => x.ProductID == productID && x.SpecialOfferID == specialOfferID); if (existing == null) { return(NotFound()); } existing.SpecialOfferID = value.SpecialOfferID; existing.ProductID = value.ProductID; existing.ModifiedDate = value.ModifiedDate; _db.Sales_SpecialOfferProduct_ondisk.Update(existing); await _db.SaveChangesAsync(); return(NoContent()); }