コード例 #1
0
        private IQueryable <Page> CreateQuery(GetPageSummariesByIdRangeQuery query)
        {
            var dbQuery = _dbContext
                          .Pages
                          .AsNoTracking()
                          .Include(p => p.Creator)
                          .FilterActive()
                          .Where(p => query.PageIds.Contains(p.PageId));

            return(dbQuery);
        }
コード例 #2
0
        public async Task <IDictionary <int, PageSummary> > ExecuteAsync(GetPageSummariesByIdRangeQuery query, IExecutionContext executionContext)
        {
            var dbResult = await CreateQuery(query).ToListAsync();

            // Finish mapping children
            var mappedResult = await _pageSummaryMapper.MapAsync(dbResult, executionContext);

            var dictionary = mappedResult.ToDictionary(d => d.PageId);

            return(dictionary);
        }
コード例 #3
0
        private IQueryable <PageSummary> CreateQuery(GetPageSummariesByIdRangeQuery query)
        {
            var dbQuery = _dbContext
                          .Pages
                          .AsNoTracking()
                          .Where(p => !p.IsDeleted && p.WebDirectory.IsActive)
                          .Where(p => query.PageIds.Contains(p.PageId))
                          .ProjectTo <PageSummary>();

            return(dbQuery);
        }
コード例 #4
0
        public Task <IDictionary <int, PageSummary> > AsSummariesAsync()
        {
            var query = new GetPageSummariesByIdRangeQuery(_pageIds);

            return(ExtendableContentRepository.ExecuteQueryAsync(query));
        }
コード例 #5
0
        public async Task <IDictionary <int, PageSummary> > ExecuteAsync(GetPageSummariesByIdRangeQuery query, IExecutionContext executionContext)
        {
            var result = await CreateQuery(query).ToListAsync();

            return(Map(result));
        }
コード例 #6
0
        public IDictionary <int, PageSummary> Execute(GetPageSummariesByIdRangeQuery query, IExecutionContext executionContext)
        {
            var result = CreateQuery(query).ToList();

            return(Map(result));
        }
コード例 #7
0
        public IContentRepositoryQueryContext <IDictionary <int, PageSummary> > AsSummaries()
        {
            var query = new GetPageSummariesByIdRangeQuery(_pageIds);

            return(ContentRepositoryQueryContextFactory.Create(query, ExtendableContentRepository));
        }