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); }
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); }
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); }
public Task <IDictionary <int, PageSummary> > AsSummariesAsync() { var query = new GetPageSummariesByIdRangeQuery(_pageIds); return(ExtendableContentRepository.ExecuteQueryAsync(query)); }
public async Task <IDictionary <int, PageSummary> > ExecuteAsync(GetPageSummariesByIdRangeQuery query, IExecutionContext executionContext) { var result = await CreateQuery(query).ToListAsync(); return(Map(result)); }
public IDictionary <int, PageSummary> Execute(GetPageSummariesByIdRangeQuery query, IExecutionContext executionContext) { var result = CreateQuery(query).ToList(); return(Map(result)); }
public IContentRepositoryQueryContext <IDictionary <int, PageSummary> > AsSummaries() { var query = new GetPageSummariesByIdRangeQuery(_pageIds); return(ContentRepositoryQueryContextFactory.Create(query, ExtendableContentRepository)); }