title: How to safely .ToLower().Contains() on possible null property
body: <pre><code>private Expression&lt;Func&lt;ProductDto, bool&gt;&gt; FilterData(ProductRequest searchQuery)
  {
      string searchString = !string.IsNullOrEmpty(searchQuery.SearchString)
             ? searchQuery.SearchString.ToLower()
             : string.Empty;
  
      return f =&gt; ((f.ProductName.ToLower().Contains(searchString))
                  || (f.ProductParentName.ToLower().Contains(searchString)));
  }
  </code></pre>
  
  <p>Sometimes <code>ProductName</code> or <code>ProductParentName</code> are null so my application crashes.</p>
  
  <p>I've tried using C# 6.0 feature null conditional operator so I wrote something like this: </p>
  
  <pre><code>return f =&gt; ((f.ProductName?.ToLower().Contains(searchString))
                      || (f.ProductParentName?.ToLower().Contains(searchString)));
  </code></pre>
  
  <p>But than I got message :</p>
  
  <blockquote>
    <p>operator || cannot be applied to operands of type <code>'bool'</code> and
    <code>'bool?'</code></p>
  </blockquote>
  
  <p>How could I ensure could will execute even if some props are null here?</p>
  
  <p>Thanks</p>
  
  <p>Cheers</p>