I need to use the distance and IsWithinDistance functions in entity framework core 5.
But when I write this,
var result = dbContext.Addresses.Where( u => u.Geometry.IsWithinDistance(geometry, km)).Select(u => u.Id).ToList();
I get an error.
Can you give me some advice on how to solve this problem.The LINQ expression 'DbSet<Address>()
.Where(o => o.Geometry.IsWithinDistance(
distance: __p_1))' could not be translated. Additional information: Translation of method 'NetTopologySuite.Geometries.Geometry.IsWithinDistance' failed. If this method can be mapped to your custom function, see https://go.microsoft.com/fwlink/?linkid=2132413 for more information. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.