public static DbObj GetInstance()
        {
            if (_instance == null)
            {
                _instance = new DbObj();

                _client   = new MongoClient(DbAddress);
                _database = _client.GetDatabase(DbName);

                if (CollectionExistsAsync("User_Account").Result == false)
                {
                    CreateCollection("User_Account").Wait();
                }

                _bsonuserCollection  = _database.GetCollection <BsonDocument>("User_Account");
                _userCollectionModel = _database.GetCollection <AccountModel>("User_Account");

                if (CollectionExistsAsync("Files").Result == false)
                {
                    CreateCollection("Files").Wait();
                }

                _bsonfilesCollection  = _database.GetCollection <BsonDocument>("Files");
                _filesCollectionModel = _database.GetCollection <MetadataModel>("Files");
            }

            return(_instance);
        }
Beispiel #2
0
        public static MetadataGateway GetInstance(DbObj dbObject)
        {
            if (_instance == null)
            {
                _instance = new MetadataGateway(dbObject);
            }

            return(_instance);
        }
Beispiel #3
0
        public static AccountGateway GetInstance(DbObj dbObject)
        {
            if (_instance == null)
            {
                _instance = new AccountGateway(dbObject);
            }

            return(_instance);
        }
 public DataGateway(DbObj dbObj)
 {
     db   = dbObj;
     data = new GenericSet <T>();
 }
Beispiel #5
0
 private MetadataGateway(DbObj dbObject) : base(dbObject)
 {
 }
Beispiel #6
0
 private AccountGateway(DbObj dbObject) : base(dbObject)
 {
 }