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(); }
public void TestSetUp() { Mapper = new MongoDbClassMapper(); Mapper.Register(); }
/// <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); }