public async Task UploadStream(Stream stream, String fileName) { _imageId = ObjectId.GenerateNewId().ToString(); await GridFs.UploadFromStreamAsync(fileName, stream, new GridFSUploadOptions { Metadata = new BsonDocument { { "FileID", ImageId } } }); }
public async Task <ObjectId> Create(Guid id, Stream stream) => await GridFs.UploadFromStreamAsync($"{id}.txt", stream);