public async Task <IActionResult> PutDReceivedItemBatch(int id, DReceivedItemBatch dReceivedItemBatch) { if (id != dReceivedItemBatch.Id) { return(BadRequest()); } _context.Entry(dReceivedItemBatch).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DReceivedItemBatchExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <DReceivedItemBatch> > PostDReceivedItemBatch(DReceivedItemBatch dReceivedItemBatch) { _context.DReceivedItemBatches.Add(dReceivedItemBatch); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDReceivedItemBatch", new { id = dReceivedItemBatch.Id }, dReceivedItemBatch)); }