Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 private async Task <bool> SupplierExists(int id, CancellationToken cancellationToken)
 {
     return(await Task.Run(() => ReadRepository.ValidateExists(_filtersProvider.ById(id)), cancellationToken));
 }