title: Display full name of all properties of an object
body: <p>I have two class :</p>
  
  <pre><code>public class Customer
  {
      public string FirstName { get; set; }
  
      public string LastName { get; set; }
  
      public DateTime Date { get; set; }
  
      public bool isActif { get; set; }
  
      public Quantity Quantity { get; set; }
  }
  
  public class Quantity
  {
      public string Color { get; set; }
  
      public int Number { get; set; }
  }
  </code></pre>
  
  <p>And one method who display all properties of one instance of my class Customer with Reflection and Recursion :</p>
  
  <pre><code>public static void DisplayProperties(object objectA)
  {
      if (objectA != null)
      {
          Type objectType;
  
          objectType = objectA.GetType();
  
          foreach (PropertyInfo propertyInfo in objectType.GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x =&gt; x.CanRead))
          {
              object valueA = propertyInfo.GetValue(objectA, null);
  
              if (typeof(IComparable).IsAssignableFrom(propertyInfo.PropertyType) || propertyInfo.PropertyType.IsPrimitive || propertyInfo.PropertyType.IsValueType)
              {
                  Console.WriteLine(propertyInfo.ReflectedType.Name + "." + propertyInfo.Name);
              }
              else
                  DisplayProperties(valueA);
          }
      }
  }
  </code></pre>
  
  <p>The result : </p>
  
  <pre><code>Customer.FirstName
  Customer.LastName
  Customer.Date
  Customer.isActif
  Quantity.Color
  Quantity.Number
  </code></pre>
  
  <p>But I want to recover the full name of property like that </p>
  
  <pre><code>Customer.FirstName
  Customer.LastName
  Customer.Date
  Customer.isActif
  Customer.Quantity.Color
  Customer.Quantity.Number
  </code></pre>
  
  <p>How to do ?</p>