PostgreSQL TimestampTZ mapped to DateTimeOffset

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
peterharris
Posts: 13
Joined: Fri 03 Jan 2014 11:13

PostgreSQL TimestampTZ mapped to DateTimeOffset

Post by peterharris » Thu 27 Feb 2014 21:52

I'm not sure if I'm doing something wrong here. Looking around the forum, it seems clear that the dotConnect for PostgreSQL data provider supports mapping the TimestampTZ data type to DateTimeOffset when using a data reader (http://forums.devart.com/viewtopic.php? ... set#p89627) and it seems that LinqConnect supports DateTimeOffset, at least for the SQL Server provider (http://forums.devart.com/viewtopic.php? ... set#p87310). So it seems that I should be able to map a TimestampTZ column to a DateTimeOffset entity property, but when I do I get a NotSupportException thrown, with the message: 'Cannot use "timestamp(6)" type value in "DateTimeOffset" type argument.'

I used Entity Developer to generate the model from my database, which it has done a great job. I manually changed the property type to DateTimeOffset, and the server data type is correctly set to TimestampTZ. If I leave it mapped to DateTime, it works fine, but of course I don't have any timezone info. All in all, I am really enjoying my experience with dotConnect for PostgreSQL, but I'm not sure what I'm doing wrong here.

I'm having a similar issue with JSON data types, but getting an InvalidOperationException instead, with the message: "Invalid datatype: JSON"
With the JSON column, I mapped it to a string property, which may be wrong... Again, it seems that JSON is a supported data type for at least the SQL Server provider.

If you need any further details from me, I'll reply as soon as I can.

Thanks

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: PostgreSQL TimestampTZ mapped to DateTimeOffset

Post by MariiaI » Fri 28 Feb 2014 12:11

'Cannot use "timestamp(6)" type value in "DateTimeOffset" type argument.'
Thank you for the report on this. We have reproduced this issue. We will investigate it and inform you about the results as soon as possible.
I'm having a similar issue with JSON data types, but getting an InvalidOperationException instead, with the message: "Invalid datatype: JSON"
Currently, it is not supported in LinqConnect. This functionality is on our roadmap. We will inform you when any results are available.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: PostgreSQL TimestampTZ mapped to DateTimeOffset

Post by MariiaI » Fri 07 Mar 2014 06:30

The bug related to the "Cannot use "timestamp(6)" type value in "DateTimeOffset" type argument" error is fixed.
New build of LinqConnect 4.4.453 is available!
It can be downloaded from http://www.devart.com/linqconnect/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=31&t=29103.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: PostgreSQL TimestampTZ mapped to DateTimeOffset

Post by MariiaI » Fri 28 Mar 2014 06:17

The JSON data type is supported and available in new build of LinqConnect 4.4.463!
New build can be downloaded from http://www.devart.com/linqconnect/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=31&t=29244.

Post Reply