public SchoolSubjectWithWeeklyClassesAndTeachersDTO GetById(int id)
        {
            var retVal = db.SchoolSubjectsRepository.GetByID(id);

            if (retVal == null)
            {
                throw new NullReferenceException();
            }
            return(SchoolSubjectToSchoolSubjectDTOConverters.SchoolSubjectToSchoolSubjectWithWeeklyClassesAndTeachersDTO(retVal));
        }
        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)));
        }
 public IEnumerable <SchoolSubjectWithWeeklyClassesAndTeachersDTO> GetAll()
 {
     return(db.SchoolSubjectsRepository.Get()
            .Select(ss => SchoolSubjectToSchoolSubjectDTOConverters.SchoolSubjectToSchoolSubjectWithWeeklyClassesAndTeachersDTO(ss)));
 }