PostgreSQL TimestampTZ mapped to DateTimeOffset
Posted: 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
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