Exemple #1
0
    public void DoSomething()
    {
        Department dept = new Department();

        // By using Property Course
        dept.Courses.Add(new Course());
        // Deliver authoroty to add Course to Department Class itself
        dept.AddCourseToCourses(new Course());
    }
Exemple #2
0
    public void DoSomething()
    {
        // Subjects
        Subject subj1 = new Subject("C#", 10);
        Subject subj2 = new Subject(".Net", 10);

        // List of Subjects
        List <Subject> advancedPrSubjects = new List <Subject>();

        advancedPrSubjects.Add(subj1);
        advancedPrSubjects.Add(subj2);

        // Course
        Course advancedProgramming = new Course(advancedPrSubjects);


        // Deliver authoroty to add Course to Department Class itself
        Department dept = new Department();

        dept.AddCourseToCourses(advancedProgramming);
    }