Page 1 of 1

EFCore DateTimeOffset vs Oracle Date - Control the offset

Posted: Tue 21 May 2019 17:34
by jwobbe.oya
We are moving from a .NET Framework solution using Oracle’s Entity Framework provider to a .NET Core solution using Devart's EFCore provider, but have one issue I can’t seem to resolve with Devart's EFCore provider...

Our application uses an old Oracle database that stores all Date/Times with the Oracle data type of Date. We also have a data model that absolutely requires that date/time like values be .NET DateTimeOffsets. As a result, changing the Oracle type or the .NET type is not an option for us.

When mapping Oracle’s Date type to .NETs DateTimeOffset, by default, Devart's EFCore provider assumes that all of those are UTC (no offset). Its a decent assumption, but it's wrong in our case. All the date/times in this database are PST. I need a way to configure / instruct Devart to default the offset to the current time zone's offset (PST) without changing the date/time value that is coming from the database .

Re: EFCore DateTimeOffset vs Oracle Date - Control the offset

Posted: Wed 22 May 2019 15:49
by Shalex
We will investigate the question and notify you about the result.

Re: EFCore DateTimeOffset vs Oracle Date - Control the offset

Posted: Mon 27 May 2019 09:24
by Shalex
You should create your own ValueConverter and apply it in the mapping.