title: How to create a map from model to Entity, and Entity to model, with AutoMapper?
body: <p>I have a model</p>
  
  <pre><code>class Account 
  {
      public string Name { get; set; }
      public string EmailAddress1 { get; set; }
  }
  </code></pre>
  
  <p>Is it possible to configure AutoMapper to somehow loop through each property on my class and map it to the correct Entity value.</p>
  
  <p>I am able to make a converter with reflection myself:</p>
  
  <pre><code>public Entity ConvertToEntity()
  {
      var propertyDict = typeof(Account).GetProperties()
        .Select(x =&gt; new KeyValuePair&lt;string, object&gt;(x.Name, x.GetValue(typeof(Account))));
      var entity = new Entity();
  
      foreach (var prop in propertyDict) t[prop.Key] = prop.Value;
  
      return entity;
   }
  </code></pre>
  
  <p>But how can i achieve the same kind of functionality with AutoMapper's CreateMap?</p>