Linq DateTime expressions wont compare if only one is nullable
- by tigermain
I have been getting the following exception:
The binary operator GreaterThanOrEqual
is not defined for the types
'System.Nullable`1[System.DateTime]'
and 'System.DateTime'.
I am getting the left hand expression from a class property which is a nullable datetime variable and my right hand side is using
Expression.Constant(new Nullable<DateTime>(DateTime.Now))
However I still get the above exception despite explicitly setting the right hand expression to a nullable type