EntityFramework6.Npgsql icon indicating copy to clipboard operation
EntityFramework6.Npgsql copied to clipboard

Map geometry/geography for EF6

Open roji opened this issue 8 years ago • 5 comments

From @roji on May 25, 2015 15:7

I happened to notice that Entity Framework's PrimitiveTypeKind enum has geography/geometry members, this probably means we can use EF to cleanly map PostgreSQL geometry types and/or PostGIS types (which aren't yet implemented: #529).

Copied from original issue: npgsql/npgsql#623

roji avatar May 12 '16 12:05 roji

From @RefactorMan on July 8, 2015 5:39

Hi,
What's your plan about this feature? Me and my company uses npgsql for very long time with EF6. We have PostGis data types in our schema, and we do patches to make it work with EF... Oh, and thanks for your great work!

roji avatar May 12 '16 12:05 roji

It's definitely something we'd like to see, but unfortunately we're much too busy with other stuff to do it at the moment (Npgsql 3.0.0, Entity Framework 7).

Also, before this can implemented, PostGIS support needs to be implemented at the Npgsql ADO.NET level (i.e. outside the EF6 provider), this is issue #529.

Note that EF7 seems to allow for totally custom types, which make it ideal for supporting PostGIS and other PostgreSQL-specific types.

Basically if anyone is willing to contribute that would be great :)

roji avatar May 12 '16 12:05 roji

Is there any progress on this? We're moving our code from NHibernate+PostGIS to EF6+PostGIS and we can define the DbGeometry type in code, doing code first doesn't work because of the 'Not supported edm type: Edm.Geometry' error.

We at least would like to know if using Npgsql is still the best option or if we should move to another provider.

pmeems avatar Mar 30 '17 13:03 pmeems

Is there any progress on this? Im still waiting.

atakansavas avatar Nov 13 '17 08:11 atakansavas

I'm sorry that there hasn't been any progress on this, but Npgsql is an open-source project and my time is limited. As this issue is flagged "up for grabs", it's basically waiting for someone to come along and implement it.

roji avatar Nov 13 '17 12:11 roji