private static void ConnectToMongoDb(ScheduleDatabaseSettings settings) { var client = new MongoClient(settings.ConnectionString); var database = client.GetDatabase(settings.DatabaseName); _schedules = database.GetCollection <Schedule>(settings.schedulesCollectionName); }
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); }