Entity Framework provides async methods for various operations. Your code should use those.
public async Task<InventoryStore> UpdateStoreAsync(InventoryStore inventory)
{
if (string.IsNullOrWhiteSpace(inventory.Name))
{
throw new ArgumentException(message: "Name is required", paramName: nameof(inventory));
}
var updatedInventory = await _db.Inventories.FindAsync(inventory.Id);
if (updatedInventory is null)
{
throw new ArgumentException(message: $"Inventory store {inventory.Id} does not exist", paramName: nameof(inventory));
}
updatedInventory.Name = inventory.Name;
updatedInventory.AccountNumber = inventory.AccountNumber;
updatedInventory.CostOfGoodSoldAccountNumber = inventory.CostOfGoodSoldAccountNumber;
await _db.SaveChangesAsync();
return updatedInventory;
}