public async Task <ActionResult <InvStore> > PostInvStore(InvStore invStore) { _context.InvStores.Add(invStore); await _context.SaveChangesAsync(); return(CreatedAtAction("GetInvStore", new { id = invStore.Id }, invStore)); }
public async Task <IActionResult> PutInvStore(int id, InvStore invStore) { if (id != invStore.Id) { return(BadRequest()); } _context.Entry(invStore).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InvStoreExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }