Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 3
0
 public async Task <Stream> GetFileStreamAsync(string taskId)
 {
     return(await _gridFs.OpenDownloadStreamByNameAsync(taskId));
 }