public virtual async Task <PagedResultDto <BlogPostListDto> > GetListAsync(BlogPostGetListInput input) { return(await RequestAsync <PagedResultDto <BlogPostListDto> >(nameof(GetListAsync), new ClientProxyRequestTypeValue { { typeof(BlogPostGetListInput), input } })); }
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)); }
public virtual Task <PagedResultDto <BlogPostListDto> > GetListAsync(BlogPostGetListInput input) { return(BlogPostAdminAppService.GetListAsync(input)); }
public virtual Task <PagedResultDto <BlogPostPublicDto> > GetListAsync(string blogSlug, BlogPostGetListInput input) { return(BlogPostPublicAppService.GetListAsync(blogSlug, input)); }
public virtual async Task <PagedResultDto <BlogPostPublicDto> > GetListAsync([NotNull] string blogSlug, BlogPostGetListInput input) { var blog = await BlogRepository.GetBySlugAsync(blogSlug); var blogPosts = await BlogPostRepository.GetListAsync(null, blog.Id, input.AuthorId, input.TagId, BlogPostStatus.Published, input.MaxResultCount, input.SkipCount, input.Sorting); return(new PagedResultDto <BlogPostPublicDto>( await BlogPostRepository.GetCountAsync(blogId: blog.Id, tagId: input.TagId, statusFilter: BlogPostStatus.Published, authorId: input.AuthorId), ObjectMapper.Map <List <BlogPost>, List <BlogPostPublicDto> >(blogPosts))); }