protected virtual byte[] DownloadAsBytes(ObjectId objectId) { var bucket = new MongoDB.Driver.GridFS.GridFSBucket(_downloadRepository.Database); var binary = bucket.DownloadAsBytesAsync(objectId, new MongoDB.Driver.GridFS.GridFSDownloadOptions() { CheckMD5 = true, Seekable = true }).Result; return(binary); }
public async Task <byte[]> GridFSBucketDownload(string id) { var bucket = new MongoDB.Driver.GridFS.GridFSBucket(_database); var binary = await bucket.DownloadAsBytesAsync(new ObjectId(id), new MongoDB.Driver.GridFS.GridFSDownloadOptions() { CheckMD5 = true }); return(binary); }
protected virtual byte[] DownloadAsBytes(ObjectId objectId) { var bucket = new MongoDB.Driver.GridFS.GridFSBucket(_downloadRepository.Database); var binary = bucket.DownloadAsBytesAsync(objectId, new MongoDB.Driver.GridFS.GridFSDownloadOptions() { CheckMD5 = true, Seekable = true }).Result; return binary; }