Exemplo n.º 1
0
        public async Task <PaginatedList <OfferModel> > Get(SearchModel model)
        {
            var spec = model.ToSpecification <Offer>();

            var entities = await _repository.Get(spec);

            var count = await _repository.CountAsync();

            return(new PaginatedList <OfferModel>(
                       model.PageIndex,
                       entities.Count,
                       count,
                       _mapper.Map <IList <OfferModel> >(entities)));
        }
Exemplo n.º 2
0
        public async Task <Offer> Get(int id)
        {
            var result = _offerRepository.Get(id);

            return(result);
        }