public static DatabaseFactory Init(MongoDbCredentials mongoCredentials) { if (_instance == null) { lock (_instanceLock) { if (_instance == null) { _instance = new DatabaseFactory(mongoCredentials); } } } return(_instance); }
private DatabaseFactory(MongoDbCredentials mongoCredentials) { this.mongoClient = new MongoClient(mongoCredentials.ConnectionString); this.MongoDatabase = mongoClient.GetDatabase(mongoCredentials.Database); }