title: get Get property from Class in Model
body: <p>I have one method for push class property into <code>NameValuCollection</code></p>
  
  <pre><code>private NameValueCollection ObjectToCollection(object objects)
  {
  
      NameValueCollection parameter = new NameValueCollection();
  
  
      Type type = objects.GetType();
  
      PropertyInfo[] properties = type.GetProperties(BindingFlags.Instance |
                                                      BindingFlags.DeclaredOnly |
                                                      BindingFlags.Public);
      foreach (PropertyInfo property in properties)
      {
          if (property.GetValue(objects, null) == null)
          {
              parameter.Add(property.Name.ToString(), "");
          }
          else
          {
              if (property.GetValue(objects, null).ToString() != "removeProp")
              {
                  parameter.Add(property.Name.ToString(), property.GetValue(objects, null).ToString());
              }
          }
      }
  
      return parameter;
      }
  </code></pre>
  
  <p>In my case when I pass My Model class to this method it's for correctly, but when in my Model class I use another Model like this</p>
  
  <pre><code>public class Brand
  {
      public MetaTags MetaTag { get; set; } // &lt;---- Problem is here
  
      public string BrandName { get; set; }
  
  }
  
  public class MetaTags
  {
      public string Title { get; set; }
  
      public string Description { get; set; }
  
      public string Language { get; set; }
  }
  </code></pre>
  
  <p>It's not add <code>MetaTag</code>s Class Property to the collection and just Add <code>MetaTag</code> to the collection</p>
  
  <p>I want this method return this <code>OutPut</code></p>
  
  <pre><code>key:Title       Value:value
  key:Description Value:value
  key:Language    Value:value
  key:BrandName   Value:value
  </code></pre>
  
  <p>But this method return this</p>
  
  <pre><code>key:MetaTag     Value:
  key:BrandName   Value:value
  </code></pre>
  
  <p>How I can do it ?</p>