title: check if a date is null from within a lambda expression and use an alternative date only if it is null
body: <p>I have some code to search for records created between two input dates (from and to) based upon the <code>createdDate</code>, however we have just imported some old  data and not all of the records have a <code>createdDate</code> which means that some records are not returned.  My idea is that when there is no <code>createdDate</code>, I use the <code>plannedStartDate</code> instead.  This is my original code:</p>
  <pre><code>mainTables = mainTables.Where(d =&gt; 
     d.n.CreatedDate &gt;= AdminSearchVm.AdminSearch.SubmittedFrom &amp;&amp;
     d.n.CreatedDate &lt;= AdminSearchVm.AdminSearch.SubmittedTo);
  </code></pre>
  <p>but I would like to do something like this:</p>
  <pre><code>mainTables = mainTables.Where(d =&gt; 
      d.n.CreatedDate == null ? d.n.PlannedStartDate :
      d.n.CreatedDate &gt;= 
             AdminSearchVm.AdminSearch.SubmittedFrom &amp;&amp; d.n.CreatedDate == null ? 
             d.n.PlannedStartDate : 
             d.n.CreatedDate &lt;= AdminSearchVm.AdminSearch.SubmittedTo);
  </code></pre>