public async Task <IActionResult> Put(int id, InventoryTransaction model) { if (id != model.Id) { return(BadRequest()); } _context.Entry(model).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!IdExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutCustomer(int id, Customer customer) { if (id != customer.Id) { return(BadRequest()); } _context.Entry(customer).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutItemGroup(int id, ItemGroup itemGroup) { if (id != itemGroup.Id) { return(BadRequest()); } _context.Entry(itemGroup).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ItemGroupExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutStoreType(int id, StoreType storeType) { if (id != storeType.Id) { return(BadRequest()); } _context.Entry(storeType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StoreTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }