I have the following code
List<DateTime?> dtDates = new List<DateTime?>()
{
null,
DateTime.Today.AddDays(1),
DateTime.Today.AddDays(-1)
};
IEnumerable<DateTime?> result = dtDates.Where(x => x > DateTime.Today);
Why doesn't it need a nullcheck like x.HasValue && x.Value > DateTime.Today
Here is a simplified version of the issue:
bool dtresult = null < DateTime.Today;
bool iresult = null < 6;
Is there a nullcheck inside the compare method?