title: Automapper ignoring ignore for properties
body: <p>I would like to ignore certain properties when mapping deep (ie levels > 1) object models.</p>
  
  <p>The following test works fine:</p>
  
  <pre><code>class Foo
  {
      public string Text { get; set; }
  }
  
  class Bar
  {
      public string Text { get; set; }
  }
  
  Mapper.CreateMap&lt;Foo, Bar&gt;()
        .ForMember(x =&gt; x.Text, opts =&gt; opts.Ignore());
  
  var foo = new Foo { Text = "foo" };
  var bar = new Bar { Text = "bar" };
  Mapper.Map(foo, bar);
  Assert.AreEqual("bar", bar.Text);
  </code></pre>
  
  <p>However when I try to do the same mapping but have Foo and Bar as properties on a parent class the following test fails:</p>
  
  <pre><code>class ParentFoo
  {
      public Foo Child { get; set; }
  }
  
  class ParentBar
  {
      public Bar Child { get; set; }
  }
  
  Mapper.CreateMap&lt;ParentFoo, ParentBar&gt;();
  
  Mapper.CreateMap&lt;Foo, Bar&gt;()
        .ForMember(x =&gt; x.Text, opts =&gt; opts.Ignore());
  
  var parentFoo = new ParentFoo          
  {
      Child = new Foo { Text = "foo" }
  };
  
  var parentBar = new ParentBar
  {
      Child = new Bar { Text = "bar" }
  };
  
  Mapper.Map(parentFoo, parentBar);
  Assert.AreEqual("bar", parentBar.Child.Text);
  </code></pre>
  
  <p>Instead of ignoring the text of the Child class (ie left it as "bar") automapper sets the value to null.  What am I doing wrong with my mapping configuration?</p>