title: AutoMapper and inheritance - How to Map?
body: <p>Have this scenario:  </p>
  
  <pre><code>public class Base {  public string Name; }
  
  public Class ClassA :Base {  public int32 Number;  }
  
  public Class ClassB :Base { public string Description;}
  
  public Class DTO {
    public string Name;
    public int32 Number;
    public string Description;
  }
  </code></pre>
  
  <p>I have an <code>IList&lt;Base&gt;</code>
  my maps are: </p>
  
  <pre><code>AutoMapper.Mapper.CreateMap&lt;IList&lt;Base&gt;, IList&lt;DTO&gt;&gt;()
     .ForMember(dest =&gt; dest.Number, opt =&gt; opt.Ignore())
     .ForMember(dest =&gt; dest.Description, opt =&gt; opt.Ignore());
  
  AutoMapper.Mapper.CreateMap&lt;ClassA, DTo&gt;()
     .ForMember(dest =&gt; dest.Description, opt =&gt; opt.Ignore());
  
  AutoMapper.Mapper.CreateMap&lt;ClassB, DTO&gt;()
     .ForMember(dest =&gt; dest.Number, opt =&gt; opt.Ignore())
  
  Mapper.AssertConfigurationIsValid(); //Is OK!
  </code></pre>
  
  <p>But Properties that are in ClassA Or ClassB are not mapped when I do this : </p>
  
  <pre><code>IList&lt;DTO&gt;= AutoMapper.Mapper.Map&lt;IList&lt;Base&gt;,IList&lt;DTO&gt;&gt;(baseList);
  </code></pre>
  
  <p>How can I do to map properties that are defined in <code>ClasA</code> and <code>ClassB</code></p>