Beispiel #1
0
 private async Task <GridFSDownloadStream <BsonValue> > FetchStream(string filename, CancellationToken cancellationToken)
 {
     try
     {
         return(await _bucket.OpenDownloadStreamByNameAsync(filename, null, cancellationToken).ConfigureAwait(false));
     }
     catch (GridFSFileNotFoundException)
     {
         return(null);
     }
 }
Beispiel #2
0
 private async Task <GridFSDownloadStream <BsonValue> > FetchStream(string filename, CancellationToken cancellationToken)
 {
     try
     {
         return(await _bucket.OpenDownloadStreamByNameAsync(
                    filename,
                    new GridFSDownloadByNameOptions { Seekable = true },
                    cancellationToken));
     }
     catch (GridFSFileNotFoundException)
     {
         return(null);
     }
 }
Beispiel #3
0
 public async Task <Stream> GetFileStreamAsync(string taskId)
 {
     return(await _gridFs.OpenDownloadStreamByNameAsync(taskId));
 }