title: Getting Automapper error when trying to map nested objects
body: <p>I have a <code>Box</code> object which has a list of <code>SerialNumber</code> objects nested within it. I'm trying to map the <code>SerialNumberName</code> property of each <code>SerialNumber</code> in each <code>Box</code> to a model called <code>BoxedElectrodesModel</code>. </p>
  
  <p><strong>Here is my <code>Box</code> class and its nested <code>SerialNumber</code> class:</strong></p>
  
  <pre><code>public partial class Box
  {
      [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
      public Box()
      {
          this.SerialNumbers = new HashSet&lt;SerialNumber&gt;();
      }
  
      public int BoxID { get; set; }
      public System.DateTime DateCreated { get; set; }
      public Nullable&lt;System.DateTime&gt; DateShipped { get; set; }
      public string TrackingNumber { get; set; }
      public Nullable&lt;System.DateTime&gt; DateReceived { get; set; }
      public bool Active { get; set; }
  
      [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
      public virtual ICollection&lt;SerialNumber&gt; SerialNumbers { get; set; }
  }
  
  public partial class SerialNumber
  {
      [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
      public SerialNumber()
      {
          this.Comments = new HashSet&lt;Comment&gt;();
          this.WIPHistories = new HashSet&lt;WIPHistory&gt;();
      }
  
      public int SerialNumberID { get; set; }
      public int IncomingLotID { get; set; }
      public string SerialNumber1 { get; set; }
      public string LamPurchaseOrder { get; set; }
      public string LamLineNumber { get; set; }
      public bool Refurbished { get; set; }
      public int WIPLocationID { get; set; }
      public int StatusID { get; set; }
      public int RouteSectionStepID { get; set; }
      public Nullable&lt;int&gt; RejectCategoryID { get; set; }
      public Nullable&lt;int&gt; BoxID { get; set; }
  
      [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
      public virtual ICollection&lt;Comment&gt; Comments { get; set; }
      public virtual IncomingLot IncomingLot { get; set; }
      public virtual RejectCategory RejectCategory { get; set; }
      public virtual Status Status { get; set; }
      public virtual WIPLocation WIPLocation { get; set; }
      [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
      public virtual ICollection&lt;WIPHistory&gt; WIPHistories { get; set; }
      public virtual Box Box { get; set; }
      public virtual RouteSectionStep RouteSectionStep { get; set; }
  }
  </code></pre>
  
  <p><strong>...and here is my 'BoxedElectrodesRowModel' class and its nested <code>SerialNumberModel</code> class:</strong></p>
  
  <pre><code>public class BoxedElectrodesRowModel
  {
      public int BoxId { get; set; }
      public List&lt;SerialNumberModel&gt; SerialNumbers { get; set; }
      public Nullable&lt;System.DateTime&gt; DateCreated { get; set; }
  }
  
  public class SerialNumberModel
  {
      public string Name { get; set; }
  }
  </code></pre>
  
  <p><strong>Here's my AutoMapper code:</strong></p>
  
  <pre><code>            c.CreateMap&lt;Box, BoxedElectrodesRowModel&gt;()
                  .ForMember(dest =&gt; dest.BoxId, opts =&gt; opts.MapFrom(src =&gt; src.BoxID))
                  .ForMember(dest =&gt; dest.SerialNumbers.Select(sn =&gt; sn.Name), opts =&gt; opts.MapFrom(src =&gt; src.SerialNumbers.Select(t =&gt; t.SerialNumberName)))
                  .ForMember(dest =&gt; dest.DateCreated, opts =&gt; opts.MapFrom(src =&gt; src.DateCreated));
  </code></pre>
  
  <p><strong>And here is my error message:</strong></p>
  
  <blockquote>
    <p>"Custom configuration for members is only supported for top-level
    individual members on a type."</p>
  </blockquote>
  
  <p>The problem, I think, has something to do with the fact that I'm trying to map the nested property <code>SerialNumberName</code> from <code>Box</code> > <code>SerialNumbers</code> to the nested property <code>Name</code> from <code>BoxedElectrodesRowModel</code> > <code>SerialNumbers</code>.</p>
  
  <p>How do I go about fixing this?</p>