예제 #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);
        }