public Task <IReadOnlyList <PostSegment> > GetInsightsAsync(PostInsightsType insightsType) { var spec = new PostInsightsSpec(insightsType, 10); return(_postRepo.SelectAsync(spec, p => new PostSegment { Id = p.Id, Title = p.Title, Slug = p.Slug, PubDateUtc = p.PubDateUtc, IsPublished = p.IsPublished, IsDeleted = p.IsDeleted, CreateOnUtc = p.CreateOnUtc, Hits = p.PostExtension.Hits })); }
public Task <IReadOnlyList <PostMetaData> > GetMPostInsightsMetaListAsync(PostInsightsType insightsType) { var spec = new PostInsightsSpec(insightsType, 10); return(_postRepository.SelectAsync(spec, p => new PostMetaData { Id = p.Id, Title = p.Title, Slug = p.Slug, PubDateUtc = p.PostPublish.PubDateUtc, IsPublished = p.PostPublish.IsPublished, IsDeleted = p.PostPublish.IsDeleted, Revision = p.PostPublish.Revision, CreateOnUtc = p.CreateOnUtc, Hits = p.PostExtension.Hits })); }
public Task <IReadOnlyList <PostSegment> > Handle(ListInsightsQuery request, CancellationToken cancellationToken) { var spec = new PostInsightsSpec(request.PostInsightsType, 10); return(_postRepo.SelectAsync(spec, PostSegment.EntitySelector)); }