Пример #1
0
 public DatabaseProvider(IContainer container, MongoDbClassMapper mapper)
 {
     MongoDefaults.MaxConnectionIdleTime = TimeSpan.FromMinutes(1);
     _container        = container;
     _client           = new Lazy <IMongoClient>(CreateMongoClient);
     _connectionString = GetConnectionString();
     _databaseName     = GetDatabaseName(_connectionString);
     mapper.Register();
 }
Пример #2
0
 public void TestSetUp()
 {
     Mapper = new MongoDbClassMapper();
     Mapper.Register();
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DatabaseProvider"/> class.
 /// </summary>
 /// <param name="container">The composition container.</param>
 /// <param name="mapper">The MongoDb class mapper.</param>
 /// <param name="connectionString">The connection string.</param>
 internal DatabaseProvider(IContainer container, MongoDbClassMapper mapper, string connectionString) : this(container, mapper)
 {
     _connectionString = connectionString;
     _databaseName     = GetDatabaseName(_connectionString);
 }