Esempio n. 1
0
        public LecturerCourse AddToCourse(int lecturerId, int courseId)
        {
            var lecturerCourse = new LecturerCourse
            {
                CourseId   = courseId,
                LecturerId = lecturerId
            };

            lecturerCourse = _lecturerCourseRepository.Add(lecturerCourse);
            return(lecturerCourse);
        }
Esempio n. 2
0
 public void TeachCourse(int lecturerId, int courseId)
 {
     if (!_lecturerCourseRepository.Records.Any(x => x.CourseId == courseId && x.LecturerId == lecturerId))
     {
         _lecturerCourseRepository.Add(new LecturerCourse
         {
             LecturerId = lecturerId,
             CourseId   = courseId
         });
     }
 }
Esempio n. 3
0
        public LecturerCourse EnrollCourse(LecturerCourse lectureCourse)
        {
            if (!_lectureCourseRepository.Records.Any(lc => lc.CourseId == lectureCourse.CourseId && lc.LecturerId == lectureCourse.LecturerId))

            {
                _lectureCourseRepository.Add(lectureCourse);

                return(lectureCourse);
            }

            else
            {
                return(null);
            }
        }