public async Task <ActionResult <InvUom> > PostInvUom(InvUom invUom) { _context.InvUoms.Add(invUom); await _context.SaveChangesAsync(); return(CreatedAtAction("GetInvUom", new { id = invUom.Id }, invUom)); }
public async Task <IActionResult> PutInvUom(int id, InvUom invUom) { if (id != invUom.Id) { return(BadRequest()); } _context.Entry(invUom).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InvUomExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }