Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MongoDBDriver{T}" /> class
 /// </summary>
 public MongoDBDriver()
 {
     this.Collection = MongoFactory.GetDefaultCollection <T>();
 }
Exemplo n.º 2
0
 /// <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);
 }
Exemplo n.º 3
0
 /// <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));
 }
Exemplo n.º 4
0
 /// <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);
 }
Exemplo n.º 5
0
 /// <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)
 {
 }