private async Task <DocumentAssetRenderDetails> GetDocumentAssetAsync(int?documentAssetId)
        {
            var getAssetQuery = new GetDocumentAssetRenderDetailsByIdQuery(documentAssetId.Value);
            var asset         = await _queryExecutor.ExecuteAsync(getAssetQuery);

            return(asset);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Simple but less efficient way of getting a document url if you only know
        /// the id. Use the overload accepting an IDocumentAssetRenderable if possible to save a
        /// potential db query if the asset isn't cached.
        /// </summary>
        /// <param name="documentAssetId">Id of the document asset to get the url for</param>
        public async Task <string> DocumentAssetAsync(int?documentAssetId)
        {
            if (!documentAssetId.HasValue)
            {
                return(string.Empty);
            }

            var getAssetQuery = new GetDocumentAssetRenderDetailsByIdQuery(documentAssetId.Value);
            var asset         = await _queryExecutor.ExecuteAsync(getAssetQuery);

            return(DocumentAsset(asset));
        }
Ejemplo n.º 3
0
        public Task <DocumentAssetRenderDetails> AsRenderDetailsAsync()
        {
            var query = new GetDocumentAssetRenderDetailsByIdQuery(_documentAssetId);

            return(ExtendableContentRepository.ExecuteQueryAsync(query));
        }
Ejemplo n.º 4
0
        public Task <DocumentAssetRenderDetails> GetDocumentAssetRenderDetailsByIdAsync(int documentAssetId, IExecutionContext executionContext = null)
        {
            var query = new GetDocumentAssetRenderDetailsByIdQuery(documentAssetId);

            return(_queryExecutor.ExecuteAsync(query, executionContext));
        }
        public IContentRepositoryQueryContext <DocumentAssetRenderDetails> AsRenderDetails()
        {
            var query = new GetDocumentAssetRenderDetailsByIdQuery(_documentAssetId);

            return(ContentRepositoryQueryContextFactory.Create(query, ExtendableContentRepository));
        }