I have database and in it I have class hotel with gps coordinates. I want to get closest places to coordinates which I choose.
I think It should look like this (I found
You can use the object initializer instead of parameterized constructor:
var nearest = (from h in db.hotels
let geo = new GeoCoordinate{ Latitude = h.gps.lat, Longitude = h.gps.lng}
orderby geo.GetDistanceTo(coord)
select h).Take(10);
But you will likely have problems caused by the GetDistanceTo method, could you provide the implementation of that method?