示例#1
0
        private static void ConnectToMongoDb(ScheduleDatabaseSettings settings)
        {
            var client   = new MongoClient(settings.ConnectionString);
            var database = client.GetDatabase(settings.DatabaseName);

            _schedules = database.GetCollection <Schedule>(settings.schedulesCollectionName);
        }
示例#2
0
        private static void Init()
        {
            var databaseName = "schedulesdb";
            var settings     = new ScheduleDatabaseSettings();
            var client       = new MongoClient(settings.ConnectionString);
            var database     = client.GetDatabase(settings.DatabaseName);

            database   = client.GetDatabase(databaseName);
            _schedules = database.GetCollection <Schedule>(_scheduleCollectionName);
        }