FirstOrDefault over DateTime when empty returns null #21836
Labels
area-query
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-bug
Milestone
Here the query that does not work as expected:
In my test "lastReadDate" is supposed to be the default value of DateTime since no last_read_date was found. But this where clause fail: where msg.created > lastReadDate I already checked that msg.created have a correct value.
But it work as as expected when I split the query in two by retrieving first the lastReadDate part and then use it in the second query like this:
I suspect this is a bug in EF Core (I use the version 3.1.6) maybe related to this issue? But maybe it's an error from my side. Do you have an idea on what is the problem?
Also here a very disturbing result with this query:
Here the result of the above query:
This is not normal that "read" and "unread" are both evaluated as false. Any idea why?
The text was updated successfully, but these errors were encountered: