public async Task <ActionResult <DItemBatch> > PostDItemBatch(DItemBatch dItemBatch) { _context.DItemBatches.Add(dItemBatch); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDItemBatch", new { id = dItemBatch.Id }, dItemBatch)); }
public async Task <IActionResult> PutDItemBatch(int id, DItemBatch dItemBatch) { if (id != dItemBatch.Id) { return(BadRequest()); } _context.Entry(dItemBatch).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DItemBatchExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }