private async Task <bool> CarAmountIsValid(OrderFromStockCreateCommand command, CancellationToken cancellationToken)
        {
            var query = await ReadRepository.GetQueryableAsync(_carStockFiltersProvider.ById(command.CarId));

            var amount = query.Select(x => x.Amount).FirstOrDefault();

            return(amount >= 1);
        }
示例#2
0
 private async Task <bool> CarExists(int id, CancellationToken cancellationToken)
 {
     return(await Task.Run(() => ReadRepository.ValidateExists(_carStockFiltersProvider.ById(id)), cancellationToken));
 }