/// <summary> /// Initializes a new instance of the <see cref="MongoDBDriver{T}" /> class /// </summary> public MongoDBDriver() { this.Collection = MongoFactory.GetDefaultCollection <T>(); }
/// <summary> /// Initializes a new instance of the <see cref="MongoDBDriver{T}" /> class /// </summary> /// <param name="collectionString">Name of the collection</param> public MongoDBDriver(string collectionString) { this.Collection = MongoFactory.GetCollection <T>(MongoDBConfig.GetConnectionString(), MongoDBConfig.GetDatabaseString(), collectionString); }
/// <summary> /// Override the Mongo driver - respects lazy loading /// </summary> /// <param name="connectionString">Connection string of mongo DB</param> /// <param name="databaseString">Database string to use</param> /// <param name="collectionString">Collection string to use</param> public void OverrideDriver(string connectionString, string databaseString, string collectionString) { this.driver = null; this.OverrideDriverGet(() => MongoFactory.GetCollection <T>(connectionString, databaseString, collectionString)); }
/// <summary> /// Initializes a new instance of the <see cref="MongoDBDriver{T}" /> class /// </summary> /// <param name="connectionString">Server address</param> /// <param name="databaseString">Name of the database</param> /// <param name="collectionString">Name of the collection</param> public MongoDBDriver(string connectionString, string databaseString, string collectionString) { this.Collection = MongoFactory.GetCollection <T>(connectionString, databaseString, collectionString); }
/// <summary> /// Initializes a new instance of the <see cref="MongoDriverManager{T}" /> class /// </summary> /// <param name="connectionString">Client connection string</param> /// <param name="databaseString">Database connection string</param> /// <param name="collectionString">Mongo collection string</param> /// <param name="testObject">Test object this driver is getting added to</param> public MongoDriverManager(string connectionString, string databaseString, string collectionString, BaseTestObject testObject) : base(() => MongoFactory.GetCollection <T>(connectionString, databaseString, collectionString), testObject) { }