Asp.Net Core does not support System.Data.Entity.Spatial.Dbgeography?

Asked

Viewed 62 times

2

Follows the project’s created property Asp.Net:

public System.Data.Entity.Spatial.DbGeography Geo { get; set; }

How can I do this in design Asp.Net Core 2.2 ?

  • 1

    I can almost assure you that no, Core still has some limitations on the more advanced and more "white fly" things, but the 3.0 is coming and may be there, a lot of stuff goes into it.

  • @Maniero Another alternative would be double ?

  • I can’t tell you, it’s not a subject I’ve mastered, but I doubt it’s a direct replacement, at most a half-assed alternative. Note that I’m speculating a little.

  • 1

    If you’re talking about Entity Framework Core yes it exists

  • The question would not be Entity Framework Core? the version is the 2.2 that has already been pointed out in response.

1 answer

3


You can use from the version of Ef Core 2.2

For this you need to install the following Nuget packages if using Sql Server:

Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite
Microsoft.EntityFrameworkCore.InMemory

There are packages for Postgres and Sqllite:

Microsoft.EntityFrameworkCore.Sqlite.NetTopologySuite
Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite

Then you need to include in your Dbcontext:

optionsBuilder.Usesqlserver(

@"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=WideWorldImporters",
x => x.UseNetTopologySuite());

For a full explanation here is here in the official documentation: Spatial Data

Browser other questions tagged

You are not signed in. Login or sign up in order to post.