static IMongoDatabase GetDatabase(MongoDbOptions dbOptions) { var client = new MongoClient(dbOptions.ConnectionString); return(client.GetDatabase(dbOptions.Database)); }
/// <inheritdoc /> public MongoDatabase(IOptions <MongoDbOptions> mongoDbOptions, ILogger <MongoDatabase> logger) { _mongoDbOptions = mongoDbOptions?.Value ?? throw new ArgumentNullException(nameof(mongoDbOptions)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); }