title: How can I map constants and class property values to a Dictionary<int, object>?
body: <p>I have an class called <code>Contact</code> and another class called <code>ContactKeys</code> that contain <code>Int32</code> constants. Each constant maps to a property of the <code>Contact</code> class and has an identical name.</p>
  
  <pre><code>public class Contact
  {
      public string Name { get; set; }
      public int Age { get; set; }
  }
  
  public static class ContactKeys
  {
      public const int Name = 5284;
      public const int Age = 9637;
  }
  </code></pre>
  
  <p>Using Automapper, I need to create a <code>Dictionary&lt;int, object&gt;</code> object where the key is a constant from <code>ContactKey</code>, and the value is provided by the property of the same name from the <code>Contact</code> class. </p>
  
  <p>From <a href="https://stackoverflow.com/questions/7310533/dictionary-string-string-map-to-an-object-using-automapper">this post</a> I can see that could potentially serialize the <code>Contact</code> class to JSON and then map it. But I don't know how to then get the constants mapped.</p>
  
  <p>Any ideas?</p>