Example #1
0
        public async Task <IActionResult> PutReceipt(int id, Receipt receipt)
        {
            if (id != receipt.ReceiptId)
            {
                return(BadRequest());
            }

            _context.Entry(receipt).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ReceiptExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
 public void UpdateProductMaterials(ProductMaterial productMaterial)
 {
     _context.Entry(productMaterial).State = EntityState.Modified;
     _context.SaveChanges();
 }