示例#1
0
        public async Task <IDictionary <int, ImageAssetRenderDetails> > ExecuteAsync(GetImageAssetRenderDetailsByIdRangeQuery query, IExecutionContext executionContext)
        {
            var cachedResults       = QueryCache(query.ImageAssetIds);
            var missingResultsQuery = QueryDb(cachedResults);
            List <ImageAssetRenderDetails> missingResults = null;

            if (missingResultsQuery != null)
            {
                var dbMissingResults = await missingResultsQuery.ToListAsync();

                missingResults = dbMissingResults
                                 .Select(_imageAssetRenderDetailsMapper.Map)
                                 .ToList();
            }

            return(AddResultsToCacheAndReturnResult(cachedResults, missingResults));
        }
示例#2
0
        public Task <IDictionary <int, ImageAssetRenderDetails> > AsRenderDetailsAsync()
        {
            var query = new GetImageAssetRenderDetailsByIdRangeQuery(_imageAssetIds);

            return(ExtendableContentRepository.ExecuteQueryAsync(query));
        }
        public IContentRepositoryQueryContext <IDictionary <int, ImageAssetRenderDetails> > AsRenderDetails()
        {
            var query = new GetImageAssetRenderDetailsByIdRangeQuery(_imageAssetIds);

            return(ContentRepositoryQueryContextFactory.Create(query, ExtendableContentRepository));
        }
示例#4
0
 public IEnumerable <IPermissionApplication> GetPermissions(GetImageAssetRenderDetailsByIdRangeQuery query)
 {
     yield return(new ImageAssetReadPermission());
 }
示例#5
0
        public Task <IDictionary <int, ImageAssetRenderDetails> > GetImageAssetRenderDetailsByIdRangeAsync(IEnumerable <int> imageAssetIds, IExecutionContext executionContext = null)
        {
            var query = new GetImageAssetRenderDetailsByIdRangeQuery(imageAssetIds);

            return(_queryExecutor.ExecuteAsync(query, executionContext));
        }