PostgreSQL tsrange Data Type Support in Entity Framework

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
cvboucher
Posts: 4
Joined: Wed 05 Aug 2015 21:43

PostgreSQL tsrange Data Type Support in Entity Framework

Post by cvboucher » Wed 05 Aug 2015 21:57

I have dotConnect for PostgreSQL Pro and in Visual Studio 2015 Community I used the Devart Entity Model template to generate a database first entity framework model. One of the table columns is a tsrange (range of timestamp without timezone) data type. This got generated as a string. Is this what is expected? It would be nice if I could work with this column with DateTime data types. Maybe a ColumnName.Lower and ColumnName.Upper. As it is now I have to format a string by doing a ToString("yyyy-MM-dd HH-mm-ss") on the DateTimes.

I see there is a PgSqlTimeStampRange class but it looks like it is only available if you are using the ADO.Net classes.

Thanks,
Craig

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

Re: PostgreSQL tsrange Data Type Support in Entity Framework

Post by Shalex » Thu 06 Aug 2015 08:45

Entity Framework supports only primitive types: http://msdn.microsoft.com/en-us/library/ee382832.aspx. From the Entity Framework's point of view, range types are not primitive.
cvboucher wrote:As it is now I have to format a string by doing a ToString("yyyy-MM-dd HH-mm-ss") on the DateTimes.
I see there is a PgSqlTimeStampRange class but it looks like it is only available if you are using the ADO.Net classes.
That is correct.

Post Reply