I am trying to migrate a webform from ASP.NET MVC to ASP.NET Core MVC. Currently I am trying to find a way to replace:
using System.Data.Entity.Spatial;
With Entity Framework Core 2.2 you can use NetTopologySuite spatial library.
You can then do a query like:
var nearestCity = db.Cities
.OrderBy(c => c.Location.Distance(currentLocation))
.FirstOrDefault();
A complete exemple is available here : https://www.markopapic.com/finding-nearby-users-using-ef-core-spatial-data/