コード例 #1
0
ファイル: MongoConfig.cs プロジェクト: kulaLin/BuildFeed
        public static void SetupIndexes()
        {
            BuildRepository b = new BuildRepository();

#pragma warning disable 4014
            b.SetupIndexes();
#pragma warning restore 4014
        }
コード例 #2
0
        public MetaItem()
        {
            _dbClient = new MongoClient(new MongoClientSettings
            {
                Server = new MongoServerAddress(MongoConfig.Host, MongoConfig.Port)
            });

            _metaCollection = _dbClient.GetDatabase(MongoConfig.Database).GetCollection <MetaItemModel>(_metaCollectionName);
            bModel          = new BuildRepository();
        }
コード例 #3
0
        public MetaItem()
        {
            var settings = new MongoClientSettings
            {
                Server = new MongoServerAddress(MongoConfig.Host, MongoConfig.Port)
            };

            if (!string.IsNullOrEmpty(MongoConfig.Username) && !string.IsNullOrEmpty(MongoConfig.Password))
            {
                settings.Credential =
                    MongoCredential.CreateCredential(MongoConfig.Database, MongoConfig.Username, MongoConfig.Password);
            }

            var dbClient = new MongoClient(settings);

            _metaCollection = dbClient.GetDatabase(MongoConfig.Database)
                              .GetCollection <MetaItemModel>(META_COLLECTION_NAME);
            _bModel = new BuildRepository();
        }
コード例 #4
0
        public static void SetupIndexes()
        {
            BuildRepository b = new BuildRepository();

            b.SetupIndexes();
        }