title: How can I convert a class into Dictionary<string,string>?
body: <p>Can I convert Class into Dictionary&lt;string, string&gt;?</p>
  <p>In Dictionary I want my class properties as <em>keys</em> and value of particular a property as the <em>value</em>.</p>
  <p>Suppose my class is</p>
  <pre><code>public class Location
  {
      public string city { get; set; }
      public string state { get; set; }
      public string country { get; set;
  }
  </code></pre>
  <p>Now suppose my data is</p>
  <pre><code>city = Delhi
  state = Delhi
  country = India
  </code></pre>
  <p>Now you can understand my point easily!</p>
  <p>I want to make a Dictionary! That dictionary should be like:</p>
  <pre><code>Dictionary&lt;string,string&gt; dix = new Dictionary&lt;string,string&gt; ();
  dix.add(&quot;property_name&quot;, &quot;property_value&quot;);
  </code></pre>
  <p>I can get the value! But how can I get property names (<strong>not value</strong>)?</p>
  <p>What should I code to create it dynamic? That should work for every class which I want.</p>
  <p>You can understand this question as:</p>
  <p>How can I get a list of properties from particular class?</p>
  <p><sub>Now again I am explaining one of my eagernesses about Dictionary! This question popuped in my mind from answer of my <a href="https://stackoverflow.com/q/9209272/1162201">previous question</a>!!</sub></p>