I would like to be able to print object properties, and I’ve hit a snag when I hit nested collections of the iLists.
foreach (PropertyInformation p in properties) { //Ensure IList type, then perform recursive call if (p.PropertyType.IsGenericType) { // recursive call to PrintListProperties<p.type?>((IList)p,' '); }
Can anyone please offer some help?
Cheers
KA
I’m just thinking aloud here. Maybe you can have a non generic PrintListProperties method that looks something like this:
Then, when you come across a nested list, do something like this:
Again, haven’t tested this, but give it a whirl…