Exemple #1
0
        public async Task <MediaResponse> GetAttachmentMediaAsync(string documentId, string attachmentId)
        {
            var attachmentResponse = await _documentClient.ReadAttachmentAsync(UriFactory.CreateAttachmentUri(_applicationConfig.Database, _applicationConfig.Collection,
                                                                                                              documentId, attachmentId));

            MediaResponse response = null;

            if (attachmentResponse != null)
            {
                response = await _documentClient.ReadMediaAsync(attachmentResponse.Resource.MediaLink);
            }

            return(response);
        }