title: how to get the "class type" of a property in a class through reflection?
body: <p>here is a piece of code</p>
  
  <pre><code> public class Order
      {
          //Primary Key
  
      public long OrderId { get; set; }
  
      //Many to One Relationship
      [ParentObject("PersonId")]
      public Person Buyer { get; set; }
  
      //One to Many Relationship
      [ChildObject("OrderId")]
      public List&lt;OrderDetail&gt; OrderDetails { get; set; }
  
      public decimal TotalAmount
      {
          get
          {
              if (OrderDetails == null)
                  return 0;
  
              return OrderDetails.Sum(o =&gt; o.LineItemCost);
          }
      }
  
      public string Notes { get; set; }
  }
  </code></pre>
  
  <p>I am trying to examine the Order object. Now what I want to do is that: get all the properties and try to find out the class type for instance</p>
  
  <pre><code>public List&lt;OrderDetail&gt; OrderDetails { get; set; }
  </code></pre>
  
  <p>I want to get the type "OrderDetail" that is another class. When I try to get it using PropertyInfo.PropertyType I get "List1" (the Generic type), PropertyInfo.GetType() gives some System.Reflection.RuntimeType, PropertyInfo.DeclaringType gives "Order" (the class that contains the property). I would be obliged if anyone can propose a solution. Thanks in advance.</p>