public async Task <List <LectureInfoDto> > GetInstructorLectures(int userId) { List <LectureInfoDto> lectureInfos = new List <LectureInfoDto>(); List <Lecture> lectures = await _lectureRepository.GetInstructorLecturesById(userId); User instructor = await _userRepository.GetUserById(userId); foreach (Lecture lecture in lectures) { lectureInfos.Add(new LectureInfoDto(lecture, instructor)); } return(lectureInfos); }