public async Task <ActionResult <SmSourceItemBatch> > PostSmSourceItemBatch(SmSourceItemBatch smSourceItemBatch) { _context.SmSourceItemBatches.Add(smSourceItemBatch); await _context.SaveChangesAsync(); return(CreatedAtAction("GetSmSourceItemBatch", new { id = smSourceItemBatch.Id }, smSourceItemBatch)); }
public async Task <IActionResult> PutSmSourceItemBatch(int id, SmSourceItemBatch smSourceItemBatch) { if (id != smSourceItemBatch.Id) { return(BadRequest()); } _context.Entry(smSourceItemBatch).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SmSourceItemBatchExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }