コード例 #1
0
        public SchoolSubjectWithWeeklyClassesAndTeachersDTO GetById(int id)
        {
            var retVal = db.SchoolSubjectsRepository.GetByID(id);

            if (retVal == null)
            {
                throw new NullReferenceException();
            }
            return(SchoolSubjectToSchoolSubjectDTOConverters.SchoolSubjectToSchoolSubjectWithWeeklyClassesAndTeachersDTO(retVal));
        }
コード例 #2
0
        public IEnumerable <SchoolSubjectWithWeeklyClassesAndTeachersDTO> GetAllByTeacherId(string teacherId)
        {
            var subjects = db.SchoolSubjectsRepository.Get(x => x.TeacherSchoolSubjects.Any(y => y.Teacher.Id == teacherId));

            return(subjects.Select(ss => SchoolSubjectToSchoolSubjectDTOConverters.SchoolSubjectToSchoolSubjectWithWeeklyClassesAndTeachersDTO(ss)));
        }
コード例 #3
0
 public IEnumerable <SchoolSubjectWithWeeklyClassesAndTeachersDTO> GetAll()
 {
     return(db.SchoolSubjectsRepository.Get()
            .Select(ss => SchoolSubjectToSchoolSubjectDTOConverters.SchoolSubjectToSchoolSubjectWithWeeklyClassesAndTeachersDTO(ss)));
 }