public void UnpublishSchedule()
        {
            MongoSchedule publishedSchedule = collection.Find(x => x.Published == true).ToListAsync().Result.First();

            publishedSchedule.Published = false;
            var filter = Builders <MongoSchedule> .Filter.Eq("id", publishedSchedule.id);

            collection.ReplaceOne(filter, publishedSchedule);
        }
        public void PutSchedule(string id, MongoSchedule newSchedule)
        {
            var filter = Builders <MongoSchedule> .Filter.Eq("id", id);

            var update = Builders <MongoSchedule> .Update
                         .Set("Rooms", newSchedule.Rooms)
                         .Set("TimeSlots", newSchedule.TimeSlots);

            collection.UpdateOne(filter, update);
        }
 public void PostSchedule(MongoSchedule schedule)
 {
     collection.InsertOne(schedule);
 }
        public void DeleteSchedule()
        {
            MongoSchedule schedule = collection.Find(x => true).ToListAsync().Result.First();

            collection.DeleteOne(s => s.id == schedule.id);
        }