public async Task <IActionResult> PutInventory([FromRoute] long id, [FromBody] Inventory inventory) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != inventory.InventoryId) { return(BadRequest()); } _context.Entry(inventory).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InventoryExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }