public async Task <ActionResult <SmMovingItemBatch> > PostSmMovingItemBatch(SmMovingItemBatch smMovingItemBatch) { _context.SmMovingItemBatches.Add(smMovingItemBatch); await _context.SaveChangesAsync(); return(CreatedAtAction("GetSmMovingItemBatch", new { id = smMovingItemBatch.Id }, smMovingItemBatch)); }
public async Task <IActionResult> PutSmMovingItemBatch(int id, SmMovingItemBatch smMovingItemBatch) { if (id != smMovingItemBatch.Id) { return(BadRequest()); } _context.Entry(smMovingItemBatch).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SmMovingItemBatchExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }