I recently upgraded to the newest version of EntityFrameworkCore.PostgreSQL but the spacial data didn't seem to work, because they now use NetTopologySuite see here
To set up the NetTopologySuite plugin, add the Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite nuget to your project. Then, make the following modification to your UseNpgsql() line:
I use the dotnet ef dbcontext scaffold
command
dotnet ef dbcontext scaffold "MyConnectionString" Npgsql.EntityFrameworkCore.PostgreSQL
however, the scaffold
command doesn't seem to use the NetTopologySuite mapping. I still get the following error
Could not find type mapping for column 'public.behaviour.coord' with data type 'geometry(Point)'. Skipping column.
How can I scaffold my database using NetTopologySuite