title: how does one compare the date part of a nullable datetime in a linq / lambda query?
body: <p>I have something like the following:</p>
  
  <pre><code>new ObservableCollection&lt;SomeData&gt;(SomeDataCollection.Where(a =&gt; a.AGD_Category.Equals((int)AGD_CategoryEnum.Med) &amp;&amp; ((a.AGG_DateStart.Date &lt;= SelectedUntill) &amp;&amp; (a.AGG_DateEnd.Value.Date &gt;= SelectedFrom))));
  </code></pre>
  
  <p>now my a.AGG_DateEnd is a nullable datetime and whenever there is a null value in the list I get an exception   because of the "a.AGG_DateEnd.Value.Date" part.</p>
  
  <p>But the thing is, the a.AGG_DateEnd also contains hours and minutes, but I do not want this causes my comparison to give unreliable results.</p>
  
  <p>What can I do to improve?</p>
  
  <p>Thank you,</p>