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 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);
        }