title: Automapper - Ignore mapping with condition
body: <p>I'm using automapper and I would like to know if it's possible to ignore a mapping of a field when that's null.</p>
  
  <p>That's my code: </p>
  
  <pre><code>.ForMember(dest =&gt; dest.BusinessGroup_Id, 
             opt =&gt; opt.MapFrom(src =&gt; (int)src.BusinessGroup))
  </code></pre>
  
  <ul>
  <li><code>src.BusinessGroup type = "enum"</code> </li>
  <li><code>dest.BusinessGroup_Id = int</code></li>
  </ul>
  
  <p>The objective it's to ingore that Mapping if src.BusinessGroup = null.</p>