Programmatically Create Collection of Property Accessor Functions
<p>What I want to do is take any class type and create a list of 'get' accessors to all of the properties in the object graph. </p>

<p>The exact format, order, etc of the collection doesn't matter, I just don't quite know how to start off identifying and creating accessors to all of the properties. It might take the form of something like this:</p>

<pre><code>public static List&lt;Func&lt;T,object&gt;&gt; CreateAccessors&lt;T&gt;()
{
   Type t = typeof(T);
   // Identify all properties and properties of properties (etc.) of T
   // Return list of lambda functions to access each one given an instance of T
}

public void MyTest()
{
   MyClass object1;
   var accessors = CreateAccessors&lt;MyClass&gt;();
   var myVal1 = accessors[0](object1);
   var myVal2 = accessors[1](object1);

   // myVal1 might now contain the value of object1.Property1
   // myVal2 might now contain the value of object1.Property4.ThirdValue.Alpha
}
</code></pre>
