public async Task CreateAsync(int itemId, int itemQuantity)
{
var item = await _itemRepository.GetAsync(itemId);
if (item.Stock < itemQuantity)
throw new Exception($"Item id=[{itemId}] has not enough stock for order.");
Order order = new()
{
ItemId = item.Id,
Quantity = itemQuantity
};
using(var creatorClass = new SomeCreatorClass())
{
/*
* another setup for creatorClass class
*/
creatorClass.CreateAsync(order);
};
}
How can I verify this line creatorClass.CreateAsync(order);
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
What if:
How can I verify this line creatorClass.CreateAsync(order);