示例#1
0
        public async Task CreateLectureForSubject(string subjectId, LectureRequestDto requestDto)
        {
            var subject = await GetSubject(subjectId);

            var theatreReference = await GetTheatreReference(requestDto.LectureSchedule.TheatreId);

            var lectureSchedule = new LectureSchedule(
                theatreReference,
                requestDto.LectureSchedule.DayOfWeek,
                requestDto.LectureSchedule.StartHour,
                requestDto.LectureSchedule.EndHour
                );

            var lecture = new Lecture(null, requestDto.Name, lectureSchedule);

            subject.AddLecture(lecture);
            await _subjectRepository.Save(subject);
        }
示例#2
0
        public async Task <IActionResult> AddLecture([FromRoute] string id, [FromBody] LectureRequestDto requestDto)
        {
            await _subjectService.CreateLectureForSubject(id, requestDto);

            return(Ok());
        }