Пример #1
0
        public IDictionary <int, RootEntityMicroSummary> Execute(GetCustomEntityEntityMicroSummariesByIdRangeQuery query, IExecutionContext executionContext)
        {
            var results = Query(query).ToDictionary(e => e.RootEntityId);

            EnforcePermissions(results, executionContext);

            return(results);
        }
Пример #2
0
        public async Task <IDictionary <int, RootEntityMicroSummary> > ExecuteAsync(GetCustomEntityEntityMicroSummariesByIdRangeQuery query, IExecutionContext executionContext)
        {
            var results = await Query(query, executionContext).ToDictionaryAsync(e => e.RootEntityId);

            EnforcePermissions(results, executionContext);

            return(results);
        }
Пример #3
0
        private IQueryable <RootEntityMicroSummary> Query(GetCustomEntityEntityMicroSummariesByIdRangeQuery query)
        {
            var dbQuery = _dbContext
                          .CustomEntityVersions
                          .AsNoTracking()
                          .FilterByActiveLocales()
                          .FilterByWorkFlowStatusQuery(WorkFlowStatusQuery.Latest)
                          .Where(v => query.CustomEntityIds.Contains(v.CustomEntityId))
                          .Select(v => new RootEntityMicroSummary()
            {
                RootEntityId         = v.CustomEntityId,
                RootEntityTitle      = v.Title,
                EntityDefinitionName = v.CustomEntity.CustomEntityDefinition.EntityDefinition.Name,
                EntityDefinitionCode = v.CustomEntity.CustomEntityDefinition.CustomEntityDefinitionCode
            });

            return(dbQuery);
        }
Пример #4
0
        private IQueryable <RootEntityMicroSummary> Query(GetCustomEntityEntityMicroSummariesByIdRangeQuery query, IExecutionContext executionContext)
        {
            var dbQuery = _dbContext
                          .CustomEntityPublishStatusQueries
                          .AsNoTracking()
                          .FilterActive()
                          .FilterByStatus(PublishStatusQuery.Latest, executionContext.ExecutionDate)
                          .Where(v => query.CustomEntityIds.Contains(v.CustomEntityId))
                          .Select(v => new RootEntityMicroSummary()
            {
                RootEntityId         = v.CustomEntityId,
                RootEntityTitle      = v.CustomEntityVersion.Title,
                EntityDefinitionName = v.CustomEntity.CustomEntityDefinition.EntityDefinition.Name,
                EntityDefinitionCode = v.CustomEntity.CustomEntityDefinition.CustomEntityDefinitionCode
            });

            return(dbQuery);
        }