Exemplo n.º 1
0
        public virtual async Task <PagedResultDto <BlogPostDto> > GetListAsync(BlogPostGetListInput input)
        {
            var blogPosts = await BlogPostRepository.GetListAsync(input.Filter, input.BlogId, input.MaxResultCount, input.SkipCount, input.Sorting);

            var count = await BlogPostRepository.GetCountAsync(input.Filter);

            var dtoList = ObjectMapper.Map <List <BlogPost>, List <BlogPostDto> >(blogPosts);

            return(new PagedResultDto <BlogPostDto>(count, dtoList));
        }
Exemplo n.º 2
0
        public virtual async Task <PagedResultDto <BlogPostListDto> > GetListAsync(BlogPostGetListInput input)
        {
            var blogs = (await BlogRepository.GetListAsync()).ToDictionary(x => x.Id);

            var blogPosts = await BlogPostRepository.GetListAsync(input.Filter, input.BlogId, input.MaxResultCount, input.SkipCount, input.Sorting);

            var count = await BlogPostRepository.GetCountAsync(input.Filter);

            var dtoList = blogPosts.Select(x =>
            {
                var dto      = ObjectMapper.Map <BlogPost, BlogPostListDto>(x);
                dto.BlogName = blogs[x.BlogId].Name;

                return(dto);
            }).ToList();

            return(new PagedResultDto <BlogPostListDto>(count, dtoList));
        }
Exemplo n.º 3
0
 public virtual Task<PagedResultDto<BlogPostListDto>> GetListAsync(BlogPostGetListInput input)
 {
     return BlogPostAdminAppService.GetListAsync(input);
 }