I have a compex object
class A
{
int Field1;
int field2;
property ClassB ClassB;
property classC classC;
etc etc....
}
I want to print the complete object graph using reflection. Any good code out there?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I did something for debugging purpose some years ago. It’s a recursive function that print all properties and sub object. The way you print is up to you. Just put the code you want in the print method. It’s not “bullet proof” but it works pretty well :
Hope it helps