Beispiel #1
0
        public static DatabaseFactory Init(MongoDbCredentials mongoCredentials)
        {
            if (_instance == null)
            {
                lock (_instanceLock)
                {
                    if (_instance == null)
                    {
                        _instance = new DatabaseFactory(mongoCredentials);
                    }
                }
            }

            return(_instance);
        }
Beispiel #2
0
 private DatabaseFactory(MongoDbCredentials mongoCredentials)
 {
     this.mongoClient   = new MongoClient(mongoCredentials.ConnectionString);
     this.MongoDatabase = mongoClient.GetDatabase(mongoCredentials.Database);
 }