コード例 #1
0
        public void ManipulatingCourses()
        {
            var kent = new Person2();

            kent.Addcourse(new Course2 {
                Name = "Smalltalk Programming", IsAdvanced = false
            });
            kent.Addcourse(new Course2 {
                Name = "TDD", IsAdvanced = true
            });

            var refactoringCourse = new Course2 {
                Name = "Refactoring", IsAdvanced = true
            };

            kent.Addcourse(refactoringCourse);

            kent.Addcourse(new Course2 {
                Name = "Jasmine", IsAdvanced = true
            });
            kent.RemoveCourse(refactoringCourse);
        }
コード例 #2
0
 public void RemoveCourse(Course2 course)
 {
     _courses.Remove(course);
 }
コード例 #3
0
        //public Person2(IEnumerable<Course2> courses)
        //    :this()
        //{
        //    _courses.AddRange(courses);
        //}

        public void Addcourse(Course2 course)
        {
            _courses.Add(course);
        }