/// <inheritdoc /> public virtual Task <IAsyncCursor <BsonDocument> > ListDatabasesAsync( IClientSessionHandle session, ListDatabasesOptions options, CancellationToken cancellationToken = default(CancellationToken)) { throw new NotImplementedException(); }
private ListDatabasesOperation CreateListDatabaseOperation( ListDatabasesOptions options, MessageEncoderSettings messageEncoderSettings) { return(new ListDatabasesOperation(messageEncoderSettings) { Filter = options.Filter?.Render(BsonDocumentSerializer.Instance, BsonSerializer.SerializerRegistry), NameOnly = options.NameOnly }); }
/// <inheritdoc /> public sealed override async Task <IAsyncCursor <string> > ListDatabaseNamesAsync( IClientSessionHandle session, CancellationToken cancellationToken = default(CancellationToken)) { var options = new ListDatabasesOptions { NameOnly = true }; var databases = await ListDatabasesAsync(session, options, cancellationToken).ConfigureAwait(false); return(CreateDatabaseNamesCursor(databases)); }
/// <inheritdoc /> public sealed override IAsyncCursor <string> ListDatabaseNames( IClientSessionHandle session, CancellationToken cancellationToken = default(CancellationToken)) { var options = new ListDatabasesOptions { NameOnly = true }; var databases = ListDatabases(session, options, cancellationToken); return(CreateDatabaseNamesCursor(databases)); }
/// <inheritdoc/> public sealed override Task <IAsyncCursor <BsonDocument> > ListDatabasesAsync( IClientSessionHandle session, ListDatabasesOptions options, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsNotNull(session, nameof(session)); options = options ?? new ListDatabasesOptions(); var messageEncoderSettings = GetMessageEncoderSettings(); var operation = CreateListDatabaseOperation(options, messageEncoderSettings); return(ExecuteReadOperationAsync(session, operation, cancellationToken)); }
private ListDatabasesOperation CreateListDatabaseOperation( ListDatabasesOptions options, MessageEncoderSettings messageEncoderSettings) { return(new ListDatabasesOperation(messageEncoderSettings) { AuthorizedDatabases = options.AuthorizedDatabases, Filter = options.Filter?.Render(BsonDocumentSerializer.Instance, BsonSerializer.SerializerRegistry), NameOnly = options.NameOnly, RetryRequested = _settings.RetryReads }); }
private ListDatabasesOptions CreateListDatabasesOptionsFromListDatabaseNamesOptions(ListDatabaseNamesOptions options) { var listDatabasesOptions = new ListDatabasesOptions { NameOnly = true }; if (options != null) { listDatabasesOptions.AuthorizedDatabases = options.AuthorizedDatabases; listDatabasesOptions.Filter = options.Filter; } return(listDatabasesOptions); }
/// <inheritdoc/> public sealed override Task <IAsyncCursor <BsonDocument> > ListDatabasesAsync( ListDatabasesOptions options, CancellationToken cancellationToken = default(CancellationToken)) { return(UsingImplicitSessionAsync(session => ListDatabasesAsync(session, options, cancellationToken), cancellationToken)); }
/// <inheritdoc /> public virtual IAsyncCursor <BsonDocument> ListDatabases( ListDatabasesOptions options, CancellationToken cancellationToken = default(CancellationToken)) { throw new NotImplementedException(); }