title: How to map IEnumerable to List using AutoMapper
body: <p>I am trying to map IEnumerable to List. I am not sure how to get it work. Here is what I have tried so far.</p>
  
  <p>I am getting an error "Custom configuration for members is only supported for top-level individual members on a type."</p>
  
  <pre><code>Source: IEnumerable&lt;Source&gt;
  Target: List&lt;Target&gt;
  
  AutoMapper.Mapper.Map(sourceIEnum, TargetList);
  
  Mapper.CreateMap&lt;IEnumerable&lt;Source&gt;, List&lt;Target&gt;&gt;()
      .ForMember(f =&gt; f, mp =&gt; mp.MapFrom(
                                      mfrom =&gt; mfrom.Select(s =&gt; AutoMapper.Mapper.Map(s, new Target())
                                  ).ToList())
                );
  
  Mapper.CreateMap&lt;Source, Target&gt;()
      .ForMember(f =&gt; f.TargetPropertyA, mp =&gt; mp.MapFrom(mfrom =&gt; mfrom.FromA.Value))
      .ForMember(f =&gt; f.TargetPropertyB, mp =&gt; mp.MapFrom(mfrom =&gt; mfrom.FromB.Value))
      .ForMember(f =&gt; f.TargetPropertyC, mp =&gt; mp.MapFrom(mfrom =&gt; mfrom.FromC.Value))
      .ForMember(f =&gt; f.InnerObjectTarget, mp =&gt; mp.MapFrom(
                                      mfrom =&gt; mfrom.Select(s =&gt; AutoMapper.Mapper.Map(s, new InnerObjectTarget())
                                  ).ToList())
                );    
  
  Mapper.CreateMap&lt;SourceInner, TargetInner&gt;()
          .ForMember(f =&gt; f.TargetInnerPropA, m =&gt; m.MapFrom(source =&gt; source.InnerA))
          .ForMember(f =&gt; f.TargetInnerPropB, m =&gt; m.MapFrom(source =&gt; source.InnerB))
          .ForMember(f =&gt; f.TargetInnerPropC, m =&gt; m.MapFrom(source =&gt; source.InnerC));
  </code></pre>