コード例 #1
0
        public IEnumerable <GetLectureDTO> GetLectures(int userId, string role)
        {
            IEnumerable <Lecture> lectureEntites;

            if (role == "teacher")
            {
                lectureEntites = _repository.GetLecturesOfTeacher(userId);
            }
            else
            {
                lectureEntites = _repository.GetLectures();
            }

            return(Mapper.Map <IEnumerable <GetLectureDTO> >(lectureEntites));
        }