static void PrintTeachers(SchoolClass schoolClass) { foreach (var teacher in schoolClass.GetTeachers) { Console.WriteLine("----------"); Console.WriteLine(teacher.Name + " teaches:"); foreach (var discipline in teacher.DisciplinesToTeach) { Console.WriteLine(discipline.Name); } Console.WriteLine("----------"); } }
public void RemoveClass(SchoolClass classToRemove) { bool removed = false; foreach (var clas in this.classesInThisSchool) { if (classToRemove.GetIdentifier == clas.GetIdentifier) { this.classesInThisSchool.Remove(clas); removed = true; break; } } if (!removed) { throw new ArgumentException("No such class exists"); } }
// Methods public void AddClass(SchoolClass classToAdd) { this.classesInThisSchool.Add(classToAdd); }