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)); }
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)); }
public IEnumerable <IPermissionApplication> GetPermissions(GetImageAssetRenderDetailsByIdRangeQuery query) { yield return(new ImageAssetReadPermission()); }
public Task <IDictionary <int, ImageAssetRenderDetails> > GetImageAssetRenderDetailsByIdRangeAsync(IEnumerable <int> imageAssetIds, IExecutionContext executionContext = null) { var query = new GetImageAssetRenderDetailsByIdRangeQuery(imageAssetIds); return(_queryExecutor.ExecuteAsync(query, executionContext)); }