public async Task <FileDocument> GetDocument(string id)
        {
            Ensure.NotNullOrEmpty(id, $"{nameof(id)} cannot be null.");

            var result = await _documentService.GetAsync(id);

            if (result != null)
            {
                await _log.LogEventReadAsync(result, GetCurrentUserId());
            }

            return(result);
        }
示例#2
0
        private async Task <Stream> DownloadDocumentAsync(FileDocument document, string userId)
        {
            Ensure.NotNull(document, $"{nameof(document)} cannot be null.");

            var physicalLocation = await GetLibraryPhysicalLocation(document.DocumentId);

            var result = await _uploadService.GetFileStreamAsync(document, physicalLocation);

            await _log.LogEventReadAsync(document, userId);

            return(result);
        }