示例#1
0
        private IQueryable <RootEntityMicroSummary> Query(GetDocumentAssetEntityMicroSummariesByIdRangeQuery query)
        {
            var definition = _entityDefinitionRepository.GetByCode(DocumentAssetEntityDefinition.DefinitionCode);

            var dbQuery = _dbContext
                          .DocumentAssets
                          .AsNoTracking()
                          .FilterByIds(query.DocumentAssetIds)
                          .Select(a => new RootEntityMicroSummary()
            {
                RootEntityId         = a.DocumentAssetId,
                RootEntityTitle      = a.Title,
                EntityDefinitionCode = definition.EntityDefinitionCode,
                EntityDefinitionName = definition.Name
            });

            return(dbQuery);
        }
示例#2
0
 public IEnumerable <IPermissionApplication> GetPermissions(GetDocumentAssetEntityMicroSummariesByIdRangeQuery query)
 {
     yield return(new DocumentAssetReadPermission());
 }
示例#3
0
        public IDictionary <int, RootEntityMicroSummary> Execute(GetDocumentAssetEntityMicroSummariesByIdRangeQuery query, IExecutionContext executionContext)
        {
            var results = Query(query).ToDictionary(e => e.RootEntityId);

            return(results);
        }
示例#4
0
        public async Task <IDictionary <int, RootEntityMicroSummary> > ExecuteAsync(GetDocumentAssetEntityMicroSummariesByIdRangeQuery query, IExecutionContext executionContext)
        {
            var results = await Query(query).ToDictionaryAsync(e => e.RootEntityId);

            return(results);
        }