Exemplo n.º 1
0
        public void DeleteStudentPhone(DeleteStudentPhoneRequest request)
        {
            if (request != null)
            {
                var dataAccess = new StudentPhoneDataAccess(request.Context);

                var phone = dataAccess.GetById(request.IdStudentPhone);

                dataAccess.Delete(phone.FirstOrDefault());
            }
        }
Exemplo n.º 2
0
        public StudentPhone UpdateStudentPhone(UpdateStudentPhoneRequest request)
        {
            StudentPhone phone = null;

            if (request != null && request.StudentPhone != null)
            {
                var dataAccess = new StudentPhoneDataAccess(request.Context);

                phone = dataAccess.Update(request.StudentPhone);
            }

            return(phone);
        }
Exemplo n.º 3
0
        public StudentPhone GetStudentPhoneById(GetStudentPhoneByIdRequest request)
        {
            StudentPhone phone = null;

            if (request != null)
            {
                var dataAccess = new StudentPhoneDataAccess(request.Context);

                var studentPhoneQuery = dataAccess.GetById(request.IdStudentPhone);

                studentPhoneQuery = studentPhoneQuery.Include(s => s.Student);

                phone = studentPhoneQuery.FirstOrDefault();
            }

            return(phone);
        }
Exemplo n.º 4
0
        public List <StudentPhone> GetAllStudentPhones(GetAllStudentPhonesRequest request)
        {
            List <StudentPhone> phones = null;

            if (request != null)
            {
                var dataAccess = new StudentPhoneDataAccess(request.Context);

                var studentPhonesQuery = dataAccess.GetAll();

                studentPhonesQuery = studentPhonesQuery.Include(s => s.Student);

                phones = studentPhonesQuery.ToList();
            }

            return(phones);
        }