public async Task <ActionResult <BillProductWaste> > PostBillProductWaste(BillProductWaste billProductWaste) { _context.BillProductWastes.Add(billProductWaste); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBillProductWaste", new { id = billProductWaste.Id }, billProductWaste)); }
public async Task <IActionResult> PutBillProductWaste(int id, BillProductWaste billProductWaste) { if (id != billProductWaste.Id) { return(BadRequest()); } _context.Entry(billProductWaste).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BillProductWasteExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }