title: Automapper : mapping with child class trouble DynamicProxies
body: <pre><code>public class MyClassA
  {
      int Id { get; set; }
      string Name { get; set; }
  
      int MyClassBId { get; set; }
      int MyClassCId { get; set; }
  }
  
  public class MyClassB
  {
      int Id { get; set; }
  }
  
  public class MyClassC
  {
      int Id { get; set; }
  }
  </code></pre>
  
  <p>I do a join : </p>
  
  <pre><code>using (var context = GetNewContext())
  {
      var liste =
          (from myA in context.MyClassA
           join myB in context.MyClassB on myA.MyClassBId equals myB.Id
           join myC in context.MyClassC on myA.MyClassCId equals myC.Id
           select MyClassA).ToList&lt;MyClassA&gt;();
  
      return Mapper.Map&lt;IList&lt;MyClassA&gt;, List&lt;MyOtherClassA&gt;&gt;(liste);
  }
  </code></pre>
  
  <p>I get this exception on the return :</p>
  
  <pre><code>Missing type map configuration or unsupported mapping.
  _FB2F4E3BBB925EC65C0AE58F6566366E06009C68B4A2C1C12EE401E77A489D87 -&gt; IMyClassB
  System.Data.Entity.DynamicProxies.SITE_FB2F4E3BBB925EC65C0AE58F6566366E06009C68B4A2C1C12EE401E77A489D87
  </code></pre>
  
  <p>The mapping is :</p>
  
  <pre><code>Mapper.CreateMap&lt;MyClassA, MyOtherClassA&gt;()
      .ForMember(x =&gt; x.MyClassB, opt =&gt; opt.Ignore())
      .ForMember(x =&gt; x.MyClassC, opt =&gt; opt.Ignore());
  </code></pre>
  
  <p>Other problem(?) ... when I try to insert, I have to do this :</p>
  
  <pre><code>var newA = Mapper.Map&lt;MyOtherClassA, MyClassA&gt;(newA);
  newA.MyClassB = null;
  newA.MyClassC = null;
  
  context.MyClassA.Add(newA);
  context.SaveChanges();
  </code></pre>