title: Inject service into an AutoMapper destination class
body: <p>Say I have a source and destination class that is mapped using AutoMapper.
  The destination has a logger service injected into the constructor.</p>
  
  <p>However, I don't know how to get the service injected into the constructor through StructureMap?</p>
  
  <p>I've tried the following:</p>
  
  <pre><code>Mapper.Initialize(m =&gt;
   {                
      m.ConstructServicesUsing(ObjectFactory.GetInstance);
   });
  </code></pre>
  
  <p>which didn't prevent me having the exception on the mapping call, I guess because the service isn't being injected in properly.</p>
  
  <p>I also tried the following:</p>
  
  <pre><code>CreateMap&lt;Source, Dest&gt;()
   .ConstructUsing(x=&gt; ObjectFactory.GetInstance&lt;ILoggerService&gt;());
  </code></pre>
  
  <p>But I get the error: <strong>cannot convert Lamda expression to delegate type</strong>, yet all the examples I have seen use this method?</p>