Entity Framework distance query

Viewed 1238

We have a table in SQL Server that contain Latitude and Longitude columns. We want to query the nearest location from a specific point using the query:

SELECT TOP (1) 
    [ID], [Lat], [Lng],
    geography::Point(32, 34, 4326).STDistance(geography::Point([Lat], [Lng], 4326)) as Dist
FROM 
    [Area]
ORDER BY 
    Dist

Is there a way to do it using EF, and let the SQL Server do the distance computation?

Thanks

1 Answers
Related