title: Automapper how to map list of one object to list of another object
body: <p>I am using the following mapping to map my data object to viewmodel object</p>
  
  <p>Source:</p>
  
  <pre><code>public class User
  {
      public string Id { get; set; }
      public IList&lt;Address&gt; Addresses {get;set;}
  }
  
  public class Address
  {
      public string Id {get;set;}
      public string Name {get;set;}
  }
  </code></pre>
  
  <p>Destination:</p>
  
  <pre><code>public class UserViewModel
  {
      public string Id {get;set;}
      public IEnumerable&lt;VMAddress&gt; VMAddress {get;set;}
  }
  
  public class VMAddress
  {
      public string Name{get;set;}
  }
  </code></pre>
  
  <p>Mapping:</p>
  
  <pre><code>Mapper.CreateMap&lt;IList&lt;Address&gt;, IList&lt;VMAddress&gt;&gt;();
  Mapper.CreateMap&lt;User, UserViewModel&gt;()
              .ForMember(d=&gt;d.VMAddress, e=&gt;e.MapFrom(s=&gt; new List&lt;Address&gt;
              {
                  new VMAddress
                  {
                      Name = s.Id
                  }
              }))
  </code></pre>
  
  <p>My mapping is not working as expected. How do i map the list of id property of the source to list of name property in the destination?</p>
  
  <p>Getting the following error:</p>
  
  <pre><code>Missing type map configuration or unsupported mapping.
  
  Mapping types:
  List`1 -&gt; User
  System.Collections.Generic.List`1[[User, ...., Version=1.1.0.0, Culture=neutral, PublicKeyToken=null]] -&gt; UserViewModel
  
  Destination path:
  UserViewModel
  
  Source value:
  System.Collections.Generic.List`1[User]
  </code></pre>
  
  <p>Thanks</p>