Example #1
0
        public StudentAddress UpdateStudentAddress(UpdateStudentAddressRequest request)
        {
            StudentAddress address = null;

            if (request != null && request.StudentAddress != null)
            {
                var dataAccess = new StudentAddressDataAccess(request.Context);

                address = dataAccess.Update(request.StudentAddress);
            }

            return(address);
        }
Example #2
0
        public List <StudentAddress> GetAllStudentAddresses(GetAllStudentAddressesRequest request)
        {
            List <StudentAddress> addresses = null;

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

                var studentAddresses = dataAccess.GetAll();

                addresses = studentAddresses.ToList();
            }

            return(addresses);
        }
Example #3
0
        public StudentAddress GetStudentAddressById(GetStudentAddressByIdRequest request)
        {
            StudentAddress address = null;

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

                var studentAddressQuery = dataAccess.GetById(request.IdStudentAddress);

                studentAddressQuery = studentAddressQuery.Include(a => a.Student);

                address = studentAddressQuery.FirstOrDefault();
            }

            return(address);
        }