title: AutoMapper AfterMap without Generics
body: <p>I need to set up an <code>AfterMap</code> for <code>AutoMapper</code> but I'm not using the generic version as I'm creating the maps as needed at run time. If I use the generic version I do this:</p>
  
  <pre><code>Mapper.CreateMap&lt;DALEntity, BLLEntity&gt;()
      .AfterMap((DALEntity dalEntity, BLLEntity bllEntity) =&gt;
          (bllEntity as DomainEntityBase).State = DomainEntityState.Unchanged);
  </code></pre>
  
  <p>Works fine. The other maps which I don't know until run time I am creating like this:</p>
  
  <pre><code>Type BLLClassType = Type.GetType(BLLClassName);
  Type DALClassType = Type.GetType(DALClassName);
  Mapper.CreateMap(DALClassType, BLLClassType);
  </code></pre>
  
  <p>But now I can't set <code>AfterMap</code>. Any suggestions? I just need to set the <code>State</code> property of the <code>bllEntity</code> after AutoMapper has done its bit.</p>