Say i have these two classes
public class Container
{
public string name { get; set; }
public Inner Inner { get; set; }
}
public class Inner
{
public string text { get; set; }
public Inner2 Innert2 { get; set; }
}
public class Inner2 {}
How would i go, given an instance of the Container class find all nested class instances. Only really concerned about the classes not the strings etc.
Needs to be generic so that if Inner had a class it would still work. Also if there is a List or Ienumerable of a class it needs to find them too.
Cheers.