title: DateTime comparison in ObjectQuery.Where
body: <p>I'm using Entity Framework, and I have a COMMENT entity.  A COMMENT has a DATEMODIFIED property, which is a Nullable Date. I'm trying to build a query that will filter COMMENTs by date, so I create a startDate object, and do the following:</p>
  
  <pre><code>Dim q As ObjectQuery(Of COMMENT) = _ 
     (From c In model.COMMENT Select c)
  
  If startDate.HasValue Then
     q = q.Where(Function(c) startDate.Value &lt;= c.DATEMODIFIED)
  End If
  </code></pre>
  
  <p>The problem is that q.toList() is not returning any comments, even though I think it should. All comments in the database have DATEMODIFIED values, and even if I pass in DateTime.MinValue as the startDate, the query still doesn't match any entities.  </p>
  
  <p>I set a breakpoint before the If-Statement and used the Visual Studio Watch Window to try and see what's going on:</p>
  
  <pre><code>q.ToList()(0).DATEMODIFIED    'Returns the expected date 
  startDate.Value               'Returns the expected date 
  startDate.Value &lt;= q.ToList()(0).DATEMODIFIED    'Returns True...
  </code></pre>
  
  <p>But once once it hits the  q = q.Where(predicate) part, q.ToList() no longer returns any entries.  I'm stumped.</p>