EF6 with spatial support

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
Posts: 1
Joined: Mon 15 Aug 2022 13:50

EF6 with spatial support

Post by msuriani » Mon 15 Aug 2022 13:54

Hello there!
I'm migrating a .Net Framework 4.7.1 application from MS SQL Server to PostgreSQL, and for that I'm using DotConnect.

Libraries added are (version
- Devart.Data
- Devart.Data.PostgreSQL
- Devart.Data.PostgreSQL.EF6
- Devart.Data.PostgreSQL.Spatials.EF6

My DbContext have this configuration:

Code: Select all

    public class Context : DbContext
        static Context()
            var config = PgSqlEntityProviderConfig.Instance;
            config.SpatialOptions.SpatialServiceType = SpatialServiceType.NetTopologySuiteSigned;
            config.SpatialOptions.GeographyDistanceUnit = DistanceMeasurementUnit.Kilometer;
            config.SpatialOptions.GeographyAreaUnit = AreaMeasurementUnit.SquareKilometer;
            config.Workarounds.DisableQuoting = true;
My properties are of type DbGeography.

I've setup everything and now I'm getting this error when querying:
Method not found: 'GeoAPI.Geometries.IGeometry NetTopologySuite.IO.WKTReader.Read(System.String)'.

Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: EF6 with spatial support

Post by Shalex » Tue 04 Oct 2022 14:34

NetTopologySuite 2.4.0 is supported in EF Core 3, EF Core 5, and EF Core 6 by dotConnect for PostgreSQL v7.23.2042 and higher.

With EF5 and EF6, NetTopologySuite 1.14 is supported only.

Post Reply