Exemplo n.º 1
0
        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);