public async Task <BinaryUploadStream> OpenUploadStreamAsync(string id) { var(success, stream) = await BinaryUploadStream.OpenAsync(_maps, _chunks, _maxChunkLenght, id, _nrwl); return(success ? stream : throw new MdbfsDuplicateKeyException("Document with specified ID already exists")); }
public async Task <BinaryUploadStream> OpenUploadStreamAsync() { var(success, stream) = await BinaryUploadStream.OpenAsync(_maps, _chunks, _maxChunkLenght, null, _nrwl); return(success ? stream : null); }
public FileUploadStream(BinaryUploadStream bus, IMongoCollection <Element> elements, Element file) { _bus = bus; _elements = elements; _file = file; _file.ID = bus.Id; _file.Opened = DateTime.Now; }
public override void Flush() { if (_bus != null) { _bus.Flush(); Element = _file; _elements.InsertOne(Element); _bus = null; } }
public new async Task FlushAsync() { if (_bus != null) { await _bus.FlushAsync(); await _elements.InsertOneAsync(_file); _bus = null; } }
public BinaryUploadStream OpenUploadStream() { var(success, stream) = BinaryUploadStream.Open(_maps, _chunks, _maxChunkLenght, null, _nrwl); return(success ? stream : null); }