Npgsql Entity Framework database first not generating point type properties

entity-framework-6 npgsql postgresql

Question

I'm attempting to generate an EDMX model with Npgsql 3.2.7, EntityFramework6.Npsgql 3.1.1 and Entity Framework 6.2 database first.

The model is generating fine except for any columns that are of the type point. For some strange reason, the properties for those columns are not being added to the entity models, everything else is added fine though.

I get the following error once model generation is done:

Error 6005: The data type 'point' is currently not supported for the target Entity Framework version; the column 'LatLong' in the table 'test.public.Nodes' was excluded.

From the documentation it seems as if the point type column is supposed to map to the NpgsqlPoint type. This doesnt seem to be happening in my case. Is there anyway to get this to work?

1
0
3/31/2018 6:01:24 PM

Accepted Answer

Entity Framework 6.x supports only a limited, closed set of types, which doesn't include PostgreSQL's point type. The documentation you're linking to is for Npgsql, the ADO.NET provider, which is the layer below the Entity Framework provider.

Entity Framework Core does have extensible type mapping and supports point out of the box, I suggest you give it a try if possible.

0
3/31/2018 6:40:28 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow