/// <summary> /// Appends UTF-8 encoded text to an existing GridFS file. /// </summary> /// <param name="remoteFileName">The remote file name.</param> /// <returns>A StreamWriter.</returns> public StreamWriter AppendText( string remoteFileName ) { var fileInfo = new MongoGridFSFileInfo(this, remoteFileName); return(fileInfo.AppendText()); }
// public methods /// <summary> /// Appends UTF-8 encoded text to an existing GridFS file. /// </summary> /// <param name="remoteFileName">The remote file name.</param> /// <returns>A StreamWriter.</returns> public StreamWriter AppendText(string remoteFileName) { using (_server.RequestStart(null, ReadPreference.Primary)) { var serverInstance = _server.RequestConnection.ServerInstance; var fileInfo = new MongoGridFSFileInfo(_server, serverInstance, _databaseName, _settings, remoteFileName); return(fileInfo.AppendText()); } }
// public methods /// <summary> /// Appends UTF-8 encoded text to an existing GridFS file. /// </summary> /// <param name="remoteFileName">The remote file name.</param> /// <returns>A StreamWriter.</returns> public StreamWriter AppendText(string remoteFileName) { if (_settings.ReadPreference != ReadPreference.Primary) { var gridFS = WithReadPreferencePrimary(); return(gridFS.AppendText(remoteFileName)); } using (_server.RequestStart(ReadPreference.Primary)) { var serverInstance = _server.RequestServerInstance; var fileInfo = new MongoGridFSFileInfo(_server, serverInstance, _databaseName, _settings, remoteFileName); return(fileInfo.AppendText()); } }
/// <summary> /// Appends UTF-8 encoded text to an existing GridFS file. /// </summary> /// <param name="remoteFileName">The remote file name.</param> /// <returns>A StreamWriter.</returns> public StreamWriter AppendText( string remoteFileName ) { var fileInfo = new MongoGridFSFileInfo(this, remoteFileName); return fileInfo.AppendText(); }
// public methods /// <summary> /// Appends UTF-8 encoded text to an existing GridFS file. /// </summary> /// <param name="remoteFileName">The remote file name.</param> /// <returns>A StreamWriter.</returns> public StreamWriter AppendText(string remoteFileName) { using (_server.RequestStart(null, ReadPreference.Primary)) { var serverInstance = _server.RequestConnection.ServerInstance; var fileInfo = new MongoGridFSFileInfo(_server, serverInstance, _databaseName, _settings, remoteFileName); return fileInfo.AppendText(); } }
// public methods /// <summary> /// Appends UTF-8 encoded text to an existing GridFS file. /// </summary> /// <param name="remoteFileName">The remote file name.</param> /// <returns>A StreamWriter.</returns> public StreamWriter AppendText(string remoteFileName) { if (_settings.ReadPreference != ReadPreference.Primary) { var gridFS = WithReadPreferencePrimary(); return gridFS.AppendText(remoteFileName); } using (_server.RequestStart(null, ReadPreference.Primary)) { var serverInstance = _server.RequestServerInstance; var fileInfo = new MongoGridFSFileInfo(_server, serverInstance, _databaseName, _settings, remoteFileName); return fileInfo.AppendText(); } }