title: c# AutoMapper ProjectTo selects all nested object properties
body: <p>Let's take such classes:</p>
  
  <pre><code>public class Child
  {
      public int Id { get; set; }
      public string Name { get; set; }
      public string ExtraProp { get; set; }
  }
  
  public class Parent
  {
      public int Id { get; set; }
      public string Text { get; set; }
      public Child Child { get; set; }
      public string ParentExtraProp { get; set; }
  }
  
  public class ChildVo
  {
      public int Id { get; set; }
      public string Name { get; set; }
  }
  
  public class ParentVo
  {
      public int Id { get; set; }
      public string Text { get; set; }
      public ChildVo Child { get; set; }
  }
  </code></pre>
  
  <p>Automapper mapping:</p>
  
  <pre><code>Mapper.CreateMap&lt;Child, ChildVo&gt;();
  //.ForSourceMember(x =&gt; x.ExtraProp, o =&gt; o.Ignore()); //does not help
  //.IgnoreAllNonExisting(); //does not help
  
  Mapper.CreateMap&lt;Parent, ParentVo&gt;();
  </code></pre>
  
  <p>and query in Linq to Nhibernate:</p>
  
  <pre><code>var test = Session.Query&lt;Parent&gt;()
              .Where(x =&gt; x.Id == myId)
              .ProjectTo&lt;ParentVo&gt;()
              .ToList();
  </code></pre>
  
  <p>ProjectTo selects only columns (properties) which are defined in ParentVo (not all properties from Parent class) - that's great. But is selects all columns (properties) from my Child class, despite the fact that they are not defined in ChildVo.
  Why does Automapper ignore my nested property mapping? Is it possible to use all defined mappings during projection?</p>