Automapper - Mapping a nested collection to a list I'm using Automapper to do some mapping from XSD-generated serialization object to more sane POCO's.

I'm having an issue with a particular type of mapping. 

public class SourceOuterObject
{
  public SourceSet SourceSet { get; set; }
}

public class SourceSet
{
  public List&lt;SourceObject&gt; SourceList{ get; set; }
}


I want to map this to:

public class TargetOuterObject
{
  public List&lt;TargetObject&gt; TargetList{ get; set; }
}


I have tried a wide variety of mapping configurations, but the only thing that I've been able to make work is this:

Mapper.CreateMap&lt;SourceOuterObject, TargetOuterObject&gt;();
Mapper.CreateMap&lt;SourceObject, TargetObject&gt;();
Mapper.CreateMap&lt;SourceSet, List&lt;TargetObject&gt;&gt;()
    .ConvertUsing(ss =&gt; ss.SourceList.Select(bs =&gt; Mapper.Map&lt;SourceObject, TargetObject&gt;(bs)).ToList());


This works but seems to be way more complicated than it should be - I feel dirty calling a mapping within a mapping config.

Is this the best I can hope for or is there a better way?
When dealing with collections, the trick is always to set up a mapping of the items in the collections and never (well, I've never seen a case that needed) a mapping from one collection to another. That's the point of the generic.

The trick I always use is to work backwards, starting with a mapping between the types inside the collections and then going up a level. If one object needs to go up 2 levels, it's time to use ForMember to get to a nested property.

What you want to do in this case is to set up the following mappings:

Mapper.CreateMap&lt;SourceObject, TargetObject&gt;();
Mapper.CreateMap&lt;SourceOuterObject, TargetOuterObject&gt;()
    .ForMember(dest =&gt; dest.TargetList, opt =&gt; opt.MapFrom(src =&gt; src.SourceSet.SourceList);