public async Task <ActionResult <ProductWaste> > PostProductWaste(ProductWaste productWaste) { _context.ProductWastes.Add(productWaste); await _context.SaveChangesAsync(); return(CreatedAtAction("GetProductWaste", new { id = productWaste.Id }, productWaste)); }
public async Task <IActionResult> PutProductWaste(int id, ProductWaste productWaste) { if (id != productWaste.Id) { return(BadRequest()); } _context.Entry(productWaste).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductWasteExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }