Пример #1
0
        public FilmsService(WhiteFilmsDatabaseSettings settings)
        {
            /* 构造函数 获得数据库Collection */
            var client   = new MongoClient(settings.ConnectionString);
            var database = client.GetDatabase(settings.DatabaseName);

            _films = database.GetCollection <Film>(settings.FilmsCollectionName);
        }
Пример #2
0
        public AccountsService(WhiteFilmsDatabaseSettings settings, PasswordsService passwordsService)
        {
            /* 构造函数 获得数据库Collection */
            var client   = new MongoClient(settings.ConnectionString);
            var database = client.GetDatabase(settings.DatabaseName);

            _accounts         = database.GetCollection <Account>(settings.AccountCollectionName);
            _passwordsService = passwordsService;
        }