title: C# Automapper -> Conditional Mapping
body: <p>I am trying to do some conditional mapping, and all the documentation and questions I have read through doesn't seem to cover this particular conditional. I was hoping someone here would have the experience or know how on the best approach to this.</p>
  
  <p>I am mapping an object that has two properties. However, I do not want to map EITHER property, if a specific property is of a value. To visualize this:</p>
  
  <pre><code>foreach(var object in objectB) {
      If (object.propertyA == "SomeValue")
          continue;
      else
          Mapper.Map&lt;ObjectA&gt;(object);
  }
  </code></pre>
  
  <p>however, I want the <code>AutoMapper</code> equivalent of the above statement. So something more like:</p>
  
  <pre><code>cfg.CreateMap&lt;ObjectB, ObjectA&gt;()
      .ForMember(dest =&gt; dest.PropertyA, m =&gt; m.Condition(source =&gt; source.PropertyA != "SomeValue"))
      .ForMember(dest =&gt; dest.PropertyB, m =&gt; m.Condition(source =&gt; source.PropertyA != "SomeVAlue" ? source.PropertyB : ignore))
  </code></pre>
  
  <p>But the above version obviously does not work.
  Thank you in advance for your assistance.</p>