Exemple #1
0
        public List <StudentDTO> FindStudents(StudentFindCriteria criteria)
        {
            if (criteria == null)
            {
                throw new ArgumentNullException("criteria");
            }

            var students             = _studentRepository.FindByCriteria(criteria);
            List <StudentDTO> result = new List <StudentDTO>();

            foreach (var student in students)
            {
                result.Add(StudentMapper.Map(student));
            }

            return(result);
        }
Exemple #2
0
        public StudentDTO Find(int studentID)
        {
            if (studentID == 0)
            {
                throw new ArgumentException("StudentID");
            }

            Student student = _studentRepository.Find(studentID);

            if (student == null)
            {
                return(null);
            }

            StudentDTO recDTO = StudentMapper.Map(student);

            return(recDTO);
        }
Exemple #3
0
        public void Add(StudentDTO recDTO)
        {
            Student student = StudentMapper.Map(recDTO);

            _studentRepository.Add(student);
        }