Possible bug ? Nullable timestamps compared
Posted: Tue 31 Jul 2012 21:52
I have created a simple oracle table ( TESTTABLE ) with ID ( number, primary key, can not be null ) and TIME ( timestamp(6), can be null )
Attempts to read contents of the table using linqConnect are failing, for
var aa = (from a in context.TESTTABLEs
where a.TIME.GetValueOrDefault().AddDays(1) > DateTime.UtcNow
select a).FirstOrDefault();
I am getting exception
The argument 'value' was the wrong type. Expected 'System.DateTime'. Actual 'System.Nullable`1[System.DateTime]'.
If TIME can not be null, there are no problems.
Attempts to read contents of the table using linqConnect are failing, for
var aa = (from a in context.TESTTABLEs
where a.TIME.GetValueOrDefault().AddDays(1) > DateTime.UtcNow
select a).FirstOrDefault();
I am getting exception
The argument 'value' was the wrong type. Expected 'System.DateTime'. Actual 'System.Nullable`1[System.DateTime]'.
If TIME can not be null, there are no problems.