I'm using Linq to query an EF6 context representing an Oracle database. I'm trying to select rows from a table based on a TIMESTAMP field, which stores datetime up to fractions of a second. It is the most bog-standard query you can write, yet it doesn't work.
data = await dbContext.MyTable.Where(x => x.Timestamp > LastTimestamp).ToArrayAsync();
This query seems to return all data from the table, regardless of the value of the timestamp. When I step through the code and inspect the properties of each entity returned, they have the correct data, with the exception that they shouldn't be part of the result set.
The entity specifies the Timestamp property as a DateTime object, is this the correct representation for the Oracle data type TIMESTAMP?
I think the issue is that the high resolution timestamp ends up always being slightly ahead of the datetime that I pass in, which has been truncated by Linq. Is there a way to handle this?
Some related questions:
Can't compare 2 dates in oracle correctly
How can I get Entity Framework with Oracle to send fractional seconds to a database in a query?