Пример #1
0
        public async Task <ActionResult <IEnumerable <AttendanceOfLectureResource> > > GetAttendanceOfLectureByName(string lectureName)
        {
            var lecture = await _lectureService.GetAllLecturesWithStudents()
                          .SingleOrDefaultAsync(l => l.Name == lectureName);

            if (lecture == null)
            {
                return(NotFound());
            }
            var attendance         = lecture.StudentLectures;
            var attendanceResource = _mapper.Map <IEnumerable <StudentLecture>, IEnumerable <AttendanceOfLectureResource> >(attendance);

            return(Ok(attendanceResource));
        }