C# - Listing class properties like Immediate window
Posted
by
Robert
on Stack Overflow
See other posts from Stack Overflow
or by Robert
Published on 2010-12-21T21:48:46Z
Indexed on
2010/12/21
21:54 UTC
Read the original article
Hit count: 164
c#
|reflection
Hi,
I store a few classes in session. I want to be able to see the values of my class properties in trace viewer. By default I only the Type name MyNamespace.MyClass. I was wondering if I overwrite the .ToString() method and use reflection to loop over all the properties and construct a string like that ... it would do the trick but just wanted to see if there is anything already out there (specially since Immediate Window has this capability) which does the same ... i.e. list the class property values in trace instead of just the Name of the class.
Thanks!
© Stack Overflow or respective owner