Ejemplo n.º 1
0
        private IQueryable <RootEntityMicroSummary> Query(GetPageEntityMicroSummariesByIdRangeQuery query)
        {
            var definition = _entityDefinitionRepository.GetByCode(PageEntityDefinition.DefinitionCode);

            var dbQuery = _dbContext
                          .PageVersions
                          .AsNoTracking()
                          .FilterByWorkFlowStatusQuery(WorkFlowStatusQuery.Latest)
                          .Where(v => query.PageIds.Contains(v.PageId))
                          .Select(v => new RootEntityMicroSummary()
            {
                RootEntityId         = v.PageId,
                RootEntityTitle      = v.Title,
                EntityDefinitionName = definition.Name,
                EntityDefinitionCode = definition.EntityDefinitionCode
            });

            return(dbQuery);
        }
Ejemplo n.º 2
0
        private IQueryable <RootEntityMicroSummary> Query(GetPageEntityMicroSummariesByIdRangeQuery query, IExecutionContext executionContext)
        {
            var definition = _entityDefinitionRepository.GetByCode(PageEntityDefinition.DefinitionCode);

            var dbQuery = _dbContext
                          .PagePublishStatusQueries
                          .AsNoTracking()
                          .FilterActive()
                          .FilterByStatus(PublishStatusQuery.Latest, executionContext.ExecutionDate)
                          .Where(q => query.PageIds.Contains(q.PageId))
                          .Select(q => q.PageVersion)
                          .Select(v => new RootEntityMicroSummary()
            {
                RootEntityId         = v.PageId,
                RootEntityTitle      = v.Title,
                EntityDefinitionName = definition.Name,
                EntityDefinitionCode = definition.EntityDefinitionCode
            });

            return(dbQuery);
        }
Ejemplo n.º 3
0
 public IEnumerable <IPermissionApplication> GetPermissions(GetPageEntityMicroSummariesByIdRangeQuery query)
 {
     yield return(new PageReadPermission());
 }
Ejemplo n.º 4
0
        public async Task <IDictionary <int, RootEntityMicroSummary> > ExecuteAsync(GetPageEntityMicroSummariesByIdRangeQuery query, IExecutionContext executionContext)
        {
            var results = await Query(query, executionContext).ToDictionaryAsync(e => e.RootEntityId);

            return(results);
        }
Ejemplo n.º 5
0
        public IDictionary <int, RootEntityMicroSummary> Execute(GetPageEntityMicroSummariesByIdRangeQuery query, IExecutionContext executionContext)
        {
            var results = Query(query).ToDictionary(e => e.RootEntityId);

            return(results);
        }