Ejemplo n.º 1
0
        static void AddOrUpdateInstructor(string courseTitle, string instructorName)
        {
            var course = Courses.SingleOrDefault(c => c.Title == courseTitle);
            var inst   = course.Instructors.SingleOrDefault(i => i.LastName == instructorName);

            if (inst == null)
            {
                var instructor = Instructors.Single(i => i.LastName == instructorName);
                course.Instructors.Add(instructor);
            }
        }