public Dictionary <int, CustomEntityRenderSummary> Execute(GetCustomEntityRenderSummariesByIdRangeQuery query, IExecutionContext executionContext) { var dbResults = Query(query).ToList(); EnforcePermissions(dbResults, executionContext); var results = _customEntityRenderSummaryMapper.MapSummaries(dbResults, executionContext); return(results.ToDictionary(r => r.CustomEntityId)); }
public IContentRepositoryQueryContext <IDictionary <int, CustomEntityRenderSummary> > AsRenderSummaries(PublishStatusQuery?publishStatus = null) { var query = new GetCustomEntityRenderSummariesByIdRangeQuery(_customEntityIds); if (publishStatus.HasValue) { query.PublishStatus = publishStatus.Value; } return(ContentRepositoryQueryContextFactory.Create(query, ExtendableContentRepository)); }
public Task <IDictionary <int, CustomEntityRenderSummary> > AsRenderSummariesAsync(PublishStatusQuery?publishStatus = null) { var query = new GetCustomEntityRenderSummariesByIdRangeQuery(_customEntityIds); if (publishStatus.HasValue) { query.PublishStatus = publishStatus.Value; } return(ExtendableContentRepository.ExecuteQueryAsync(query)); }
private IQueryable <CustomEntityVersion> Query(GetCustomEntityRenderSummariesByIdRangeQuery query) { var dbQuery = _dbContext .CustomEntityVersions .AsNoTracking() .Where(v => query.CustomEntityIds.Contains(v.CustomEntityId)) .FilterByWorkFlowStatusQuery(query.WorkFlowStatus) .Include(e => e.CustomEntity) .Include(e => e.CustomEntity.Locale); return(dbQuery); }
private async Task <List <CustomEntityVersion> > QueryAsync(GetCustomEntityRenderSummariesByIdRangeQuery query, IExecutionContext executionContext) { if (query.PublishStatus == PublishStatusQuery.SpecificVersion) { throw new InvalidOperationException("PublishStatusQuery.SpecificVersion not supported in GetCustomEntityRenderSummariesByDefinitionCodeQuery"); } var dbQuery = await _dbContext .CustomEntityPublishStatusQueries .AsNoTracking() .Include(e => e.CustomEntityVersion) .ThenInclude(e => e.CustomEntity) .FilterByActive() .FilterByStatus(query.PublishStatus, executionContext.ExecutionDate) .Where(v => query.CustomEntityIds.Contains(v.CustomEntityId)) .ToListAsync(); return(dbQuery .Select(v => v.CustomEntityVersion) .ToList()); }
public Task <IDictionary <int, CustomEntityRenderSummary> > GetCustomEntityRenderSummariesByIdRangeAsync(GetCustomEntityRenderSummariesByIdRangeQuery query, IExecutionContext executionContext = null) { return(_queryExecutor.ExecuteAsync(query, executionContext)); }
public async Task <IDictionary <int, CustomEntityRenderSummary> > ExecuteAsync(GetCustomEntityRenderSummariesByIdRangeQuery query, IExecutionContext executionContext) { var dbResults = await QueryAsync(query, executionContext); EnforcePermissions(dbResults, executionContext); var results = await _customEntityRenderSummaryMapper.MapAsync(dbResults, executionContext); return(results.ToDictionary(r => r.CustomEntityId)); }