Beispiel #1
0
        public async Task <IEnumerable <CustomEntityVersionSummary> > ExecuteAsync(GetCustomEntityVersionSummariesByCustomEntityIdQuery query, IExecutionContext executionContext)
        {
            var definitionCode = await _dbContext
                                 .CustomEntities
                                 .AsNoTracking()
                                 .Where(c => c.CustomEntityId == query.CustomEntityId)
                                 .Select(c => c.CustomEntityDefinitionCode)
                                 .FirstOrDefaultAsync();

            if (definitionCode == null)
            {
                return(null);
            }

            _permissionValidationService.EnforceCustomEntityPermission <CustomEntityReadPermission>(definitionCode);

            var versions = await Query(query.CustomEntityId).ToListAsync();

            if (versions == null)
            {
                return(null);
            }

            return(versions);
        }
        public Task <IEnumerable <CustomEntityVersionSummary> > GetCustomEntityVersionSummariesByCustomEntityIdAsync(int id, IExecutionContext executionContext = null)
        {
            var query = new GetCustomEntityVersionSummariesByCustomEntityIdQuery()
            {
                CustomEntityId = id
            };

            return(_queryExecutor.ExecuteAsync(query, executionContext));
        }
Beispiel #3
0
        public async Task <PagedQueryResult <CustomEntityVersionSummary> > ExecuteAsync(GetCustomEntityVersionSummariesByCustomEntityIdQuery query, IExecutionContext executionContext)
        {
            var definitionCode = await _dbContext
                                 .CustomEntities
                                 .AsNoTracking()
                                 .Where(c => c.CustomEntityId == query.CustomEntityId)
                                 .Select(c => c.CustomEntityDefinitionCode)
                                 .FirstOrDefaultAsync();

            if (definitionCode == null)
            {
                return(null);
            }

            _permissionValidationService.EnforceCustomEntityPermission <CustomEntityReadPermission>(definitionCode, executionContext.UserContext);

            var dbVersions = await Query(query.CustomEntityId).ToPagedResultAsync(query);

            var versions = _customEntityVersionSummaryMapper.MapVersions(query.CustomEntityId, dbVersions);

            return(versions);
        }
Beispiel #4
0
 public Task <PagedQueryResult <CustomEntityVersionSummary> > AsVersionSummariesAsync(GetCustomEntityVersionSummariesByCustomEntityIdQuery query)
 {
     return(ExtendableContentRepository.ExecuteQueryAsync(query));
 }
Beispiel #5
0
 public Task <PagedQueryResult <CustomEntityVersionSummary> > GetCustomEntityVersionSummariesByCustomEntityIdAsync(GetCustomEntityVersionSummariesByCustomEntityIdQuery query, IExecutionContext executionContext = null)
 {
     return(_queryExecutor.ExecuteAsync(query, executionContext));
 }
 public IContentRepositoryQueryContext <PagedQueryResult <CustomEntityVersionSummary> > AsVersionSummaries(GetCustomEntityVersionSummariesByCustomEntityIdQuery query)
 {
     return(ContentRepositoryQueryContextFactory.Create(query, ExtendableContentRepository));
 }