We're having an issue when using the entity framework core value converter (https://docs.microsoft.com/en-us/ef/cor ... onversions) in order to convert a column in an Oracle database that is stored as an int and representated by unix epoch time.
Here is what we use in our dbcontext to set up the column. Note that this does work with other entity framework providers as well as a couple of open source Oracle Entity Framework providers.
Code: Select all
var intDateConverter = new ValueConverter<DateTime, int>(
v => v.ToEpochTime(),
v => v.ToDateTimeFromEpoch()
);
entity.Property(p => p.CreateDate).HasColumnName("CREATE_DATE").HasConversion(intDateConverter);
This seems to function OK when doing basic SELECTs and the model seems to convert ok but when doing anything that requires a filter such as
Code: Select all
model.Where(m => m.CreateDate > someDateTime);
Code: Select all
SELECT CREATE_DATE from TABLENAME
WHERE CREATE_DATE > TO_DATE('2018-10-03', 'yyyy-mm-dd')
Code: Select all
Devart.Data.Oracle.OracleException (0x80004005): ORA-00932: inconsistent datatypes: expected NUMBER got DATE
Thanks