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)));
        }