title: Map a list with properties to an object C#
body: <p>I would like to know how to map a list with 'keyvaluepair' including properties to an object. 
  Would be nice to resolve it with AutoMapper, but any suggestions would be very kind.</p>
  
  <p>Here's how I would like it to work with FooBar that got properties and a list of key/values that depending on the properties matching with FooBars properties should be mapped: </p>
  
  <pre><code>// AutoMapper
  var mappedFooBar = Mapper.Map&lt;IEnumerable&lt;KeyValuePair&lt;string, object&gt;&gt; FooBar&gt;(fooBar);
  </code></pre>
  
  <p>I have been struggling with this for a while now so any suggestions would be nice.
  Also tried to map with reflection, but cannot seem to get it to work.</p>
  
  <p>Thanks in advance.</p>