示例#1
0
        public async Task <IActionResult> CreateSpecialOfferProduct_inmem([FromBody] Sales.SpecialOfferProduct_inmem value)
        {
            _db.Sales_SpecialOfferProduct_inmem.Add(value);
            await _db.SaveChangesAsync();

            return(Ok(value));
        }
示例#2
0
        public async Task <IActionResult> EditSpecialOfferProduct_inmem(int productID, int specialOfferID, [FromBody] Sales.SpecialOfferProduct_inmem value)
        {
            var existing = await _db.Sales_SpecialOfferProduct_inmem.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_inmem.Update(existing);
            await _db.SaveChangesAsync();

            return(NoContent());
        }