public async Task <SupplierModel> GetByIdAsync(int id) { var supplier = await ReadRepository.GetSingleAsync(_filtersProvider.ById(id), _relationsProvider.JoinBrandAndCountry); if (supplier == null) { throw new NotFoundException("Item was not found!"); } return(Mapper.Map <SupplierModel>(supplier)); }
private async Task <bool> SupplierExists(int id, CancellationToken cancellationToken) { return(await Task.Run(() => ReadRepository.ValidateExists(_filtersProvider.ById(id)), cancellationToken)); }