title: Automapping Collections
body: <p>I am using <a href="https://github.com/AutoMapper/AutoMapper" rel="nofollow">Automapper</a> for mapping my domain model and DTO.
  When I map <code>Mapper.Map&lt;SiteDTO, SiteEntity&gt;</code> <strong>it works fine</strong>. </p>
  
  <blockquote>
    <p><strong>But when I use collections of the same entities, it doesn't map.</strong></p>
  </blockquote>
  
  <pre><code> Mapper.Map&lt;Collection&lt;SiteEntity&gt;, Collection&lt;SiteDTO&gt;&gt;(siteEntityCollection);
  </code></pre>
  
  <p>AS per Automapper <a href="https://github.com/AutoMapper/AutoMapper/wiki/Lists-and-arrays" rel="nofollow">Wiki</a>, it says the lists implementing <code>ICollection</code> would be mapped, I am using Collection that implements ICollection, but automapper doesn't map it. Am I doing something wrong.</p>
  
  <pre><code>public class SiteEntity //SiteDTO has exactly the same properties, so I am not posting it here.
      {
          public int SiteID { get; set; }
          public string Code { get; set; }
          public string Name { get; set; }
          public byte Status { get; set; }
          public int ModifiedBy { get; set; }
          public DateTime ModifiedDate{ get; set; }
          public long TimeStamp{ get; set; }
          public string Description{ get; set; }
          public string Notes{ get; set; }
          public ObservableCollection&lt;AreaEntity&gt; Areas{ get; set; }
          public void SiteEntity()
           {
             Areas=new ObservableCollection&lt;AreaEntity&gt;();
           }
       }
  </code></pre>
  
  <p><strong>EDIT:</strong> SiteEntity updated to include the constructor.</p>