Example #1
0
        public ActionResult <PagedListDto <ArticleWithIncludeDto> > GetList([FromQuery] ArticleQueryDto dto,
                                                                            [FromQuery] string include, [FromQuery] Paging paging)
        {
            PagedListDto <ArticleWithIncludeDto> list = _app.GetList(dto, include, paging);

            return(Ok(list));
        }
Example #2
0
        public PagedListDto <ArticleWithIncludeDto> GetList(ArticleQueryDto dto, string include, Paging paging)
        {
            var spec  = new ArticleFilterSpecification(dto.CategoryId, dto.TagId, dto.Keywords);
            int count = _articleDomainService.Count(spec);

            spec.ApplyPaging(paging);
            var list = _articleDomainService.List(spec);

            var listIncludes = list.Select(e =>
            {
                ArticleWithIncludeDto toDto = Mapper.Map <ArticleWithIncludeDto>(e);
                HandleInclude(toDto, include);
                return(toDto);
            });

            return(new PagedListDto <ArticleWithIncludeDto>(count, list.Select(e => Mapper.Map <ArticleWithIncludeDto>(e))));
        }
Example #3
0
 public IPagedResult <ArticleListDto> GetList(ArticleQueryDto dto)
 {
     return(_articleDomainService.GetList(dto.keywords, dto.tagId, dto.categoryId)
            .MapTo <Article, ArticleListDto>());
 }
Example #4
0
 public IPagedResult <ArticleDto> GetList([FromQuery] ArticleQueryDto dto)
 {
     return(_articleAppService.GetList(dto));
 }