예제 #1
0
        public async Task <PaginatedList <IngredientModel> > Get(SearchModel model)
        {
            var spec = model.ToSpecification <Persistance.Models.Ingredients>();

            var entities = await _repository.Get(spec);

            var count = await _repository.CountAsync();

            return(new PaginatedList <IngredientModel>(
                       model.PageIndex,
                       entities.Count,
                       count,
                       _mapper.Map <IList <IngredientModel> >(entities)));
        }