title: AutoMapper not mapping sub property
body: <p>I am receiving an issue with automapper v6.0.2 where automapper is trying to shove an <code>ICollection</code> into an <code>int</code> instead of the specified collection.</p>
  
  <p>Error:</p>
  
  <pre><code>    Mapping types:
  Member_B3B146AB4F61AEDE3DF3639BDBD65BFA5BCA0FC414F11960DC39DA834F2A8CBD -&gt; ICollection`1
  System.Data.Entity.DynamicProxies.Memberr_B3B146AB4F61AEDE3DF3639BDBD65BFA5BCA0FC414F11960DC39DA834F2A8CBD -&gt; System.Collections.Generic.ICollection`1[[MemberService.Dto.DependentDetailDto, MemberService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]
  
  Destination path:
  MemberDetailDto.Dependents.Dependents
  
  Source value:
  System.Data.Entity.DynamicProxies.MbmRosterSubscriber_B3B146AB4F61AEDE3DF3639BDBD65BFA5BCA0FC414F11960DC39DA834F2A8CBD ---&gt; System.OverflowException: Value was either too large or too small for an Int32.
  </code></pre>
  
  <p>Member </p>
  
  <pre><code>public Member ()
  {
     this.Dependents = new HashSet&lt;Dependent&gt;();
  }
  public virtual ICollection&lt;Dependent&gt; Dependents { get; set; }
  </code></pre>
  
  <p>AutoMapper Config</p>
  
  <pre><code>CreateMap&lt;Dependent, DependentDetailDto&gt;();
  CreateMap&lt;Member, MemberDetailDto&gt;()
                  .ForMember(a =&gt; a.Dependents, o =&gt; o.MapFrom(x =&gt; Mapper.Map&lt;ICollection&lt;Dependent&gt;, ICollection&lt;DependentDetail&gt;&gt;(x.Dependents)));
  </code></pre>
  
  <p>Dependent:</p>
  
  <pre><code>        public string Title { get; set; }
          public string FirstName { get; set; }
          public string LastName { get; set; }
          public string MiddleName { get; set; }
          public System.DateTime Dob { get; set; }
          public string Sex { get; set; }
          public string Relationship { get; set; }
          public string CreatedBy { get; set; }
          public string ModifiedBy { get; set; }
          public string DepartmentCode { get; set; }
          public string Address1 { get; set; }
          public string Address2 { get; set; }
          public string Address3 { get; set; }
          public string City { get; set; }
          public string State { get; set; }
          public string MailCountry { get; set; }
          public string Zip { get; set; }
          public Nullable&lt;System.DateTime&gt; SsnEncryptDate { get; set; }
  </code></pre>
  
  <p>When Dependents is removed Subscriber maps perfectly</p>
  
  <p>As for the <code>Dependent</code> Entity and <code>Model</code> they are copy and paste with all items <code>public</code>. It appears as if AutoMapper is trying to squeeze the collection into an <code>int</code> instead of the specified map.</p>
  
  <p>Any Ideas?</p>
  
  <p><code>Dependents</code> is a navigation property</p>
  
  <p>Edit :
  This was being tested in a functional test in an async method.
  Quick unit test has been created:</p>
  
  <pre><code>[TestMethod]
  public  void RetrieveActiveMember()
  {
      MemberEntity.Member Subscriber = new Member();
      ICollection&lt;Dependent&gt; Dependent = new List&lt;Dependent&gt;();
      Dependent.Add(new Dependent { HostCountry = "HOME" });
      Subscriber.Dependents = Dependent;
  
      var Mapped = AutoMapper.Mapper.Map&lt;Member, MemberDetailDto&gt;(Subscriber);
  
      Assert.IsNotNull(Mapped);
  }
  </code></pre>
  
  <p>Error being returned now is Method 'Add' in type X does not have an implementation'</p>
  
  <pre><code>Property:
  Dependents ---&gt; System.TypeLoadException: Method 'Add' in type 'Proxy&lt;System.Collections.Generic.ICollection`1[[MemberService.Dto.DependentDetailDto_MemberService_Version=1.0.0.0_Culture=neutral_PublicKeyToken=null]]_mscorlib_Version=4.0.0.0_Culture=neutral_PublicKeyToken=b77a5c561934e089&gt;' from assembly 'AutoMapper.Proxies, Version=0.0.0.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005' does not have an implementation.
  </code></pre>
  
  <p>Changing The automapper config for the dependent to</p>
  
  <pre><code>CreateMap&lt;ICollection&lt;Dependent&gt;, ICollection&lt;DependentDetailDto&gt;&gt;()
                  .ConstructUsing((ICollection&lt;Dependent&gt; Dependents) =&gt; {
                      List&lt;DependentDetailDto&gt; DependentList = new List&lt;DependentDetailDto&gt;();
                      foreach (var Dependent in Dependents)
                          DependentList.Add(new DependentDetailDto { });
                  return DependentList;
              });
  </code></pre>
  
  <p>Makes the unit test work albeit no longer actually using Automapper which is a big caveat, however it still breaks on the functional test</p>
  
  <p>I can't think of anything else to add as Dependents does not even have an integer field</p>
  
  <p>Addendum: The entity, the Dto, and the caller are all in different libraries but I have not been able to replicate it in .NETFiddle</p>