title: Is there a way to transform a list of key/value pairs into a data transfer object
body: <p>...apart from the obvious looping through the list and a dirty great case statement!</p>
  
  <p>I've turned over a few Linq queries in my head but nothing seems to get anywhere close.</p>
  
  <p>Here's the an example DTO if it helps:</p>
  
  <pre><code>    class ClientCompany
      {
        public string Title { get; private set; }
        public string Forenames { get; private set; }
        public string Surname { get; private set; }
        public string EmailAddress { get; private set; }
        public string TelephoneNumber { get; private set; }
        public string AlternativeTelephoneNumber { get; private set; }
        public string Address1 { get; private set; }
        public string Address2 { get; private set; }
        public string TownOrDistrict { get; private set; }
        public string CountyOrState { get; private set; }
        public string PostCode { get; private set; }
      }
  </code></pre>
  
  <p>We have no control over the fact that we're getting the data in as KV pairs, I'm afraid.</p>
  
  <p>and whilst there is an effective mapping of each KV pair to each property and I do know the keys in advance they're not named the same as the DTO.</p>