Question

I want to map the postgres type point to the Devart.Data.PostgreSql.PqSqlPoint structure. I found a table (devart PgSqlTypes) in which is stated for point: "May be represented as the PgSqlPoint class or the Srting".

However in devart's Entity Developer I can only choose Dot.Net standard types like String,Byte,Int16,Int32,Boolean etc. for the generated entity's respective property and did not find a way to select Devart.Data.PostgreSql.PqSqlPoint as type.

Would this be possible somehow or will I allways have to do the conversions myself in the code of my property's getter?

Your help is much appreciated.

p.s. We are using Entity Framework as ORM framework.

Was it helpful?

Solution

  1. Entity Framework supports only primitive types: http://msdn.microsoft.com/en-us/library/ee382832.aspx . From the Entity Framework's point of view, a PqSqlPoint is not a primitive type. As a woraround, map the point column in the database to the string property in both CSDL and SSDL parts of your model. Additionally, you can create a PqSqlPoint property (it will convert string to PqSqlPoint) in the partial class: http://www.devart.com/dotconnect/postgresql/docs/?Devart.Data.PostgreSql~Devart.Data.PostgreSql.PgSqlPoint~Parse.html . But it will be readonly.

  2. We are going to support PostGIS in our Entity Framework implementation. Are you interested in this feature? If yes, we can send you our internal build before the release to take into account your remarks and suggestions in the final version.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top