title: Automapper for member condition
body: <p>I am using auto mapper 6.1 and I want to map some values from one object to another, but there is a condition that those values can not be null and not all object properties are supposed to be mapped if so I could easily use ForAllMembers conditions. What I am trying to do is:</p>
  
  <pre><code>   config.CreateMap&lt;ClassA, ClassB&gt;()
       .ForMember(x =&gt; x.Branch, opt =&gt; opt.Condition(src =&gt; src.Branch != null), 
          cd =&gt; cd.MapFrom(map =&gt; map.Branch ?? x.Branch))
  </code></pre>
  
  <p>Also tried </p>
  
  <pre><code> config.CreateMap&lt;ClassA, ClassB&gt;().ForMember(x =&gt; x.Branch, cd =&gt; {
     cd.Condition(map =&gt; map.Branch != null);
     cd.MapFrom(map =&gt; map.Branch);
   })
  </code></pre>
  
  <p>In another words for every property I define in auto mapper configuration I want to check if its null, and if it is null leave value from x.</p>
  
  <p>Call for such auto mapper configuration would look like:</p>
  
  <pre><code> ClassA platform = Mapper.Map&lt;ClassA&gt;(classB);
  </code></pre>