EFCore DateTimeOffset vs Oracle Date - Control the offset

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
jwobbe.oya
Posts: 2
Joined: Wed 30 Jan 2019 23:26

EFCore DateTimeOffset vs Oracle Date - Control the offset

Post by jwobbe.oya » Tue 21 May 2019 17:34

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 .

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: EFCore DateTimeOffset vs Oracle Date - Control the offset

Post by Shalex » Wed 22 May 2019 15:49

We will investigate the question and notify you about the result.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: EFCore DateTimeOffset vs Oracle Date - Control the offset

Post by Shalex » Mon 27 May 2019 09:24

You should create your own ValueConverter and apply it in the mapping.

Post Reply