I have this situation: I need to find nearby location using lat and long. Using this:
var coord = new GeoCoordinate(latitude, longitude);
var nearest = context.ParkingSpaces.Select(x => new GeoCoordinate(x.Latitude.Value, x.Longitude.Value))
.OrderBy(x => x.GetDistanceTo(coord)).First();
But I am getting following error:
Only parameterless constructors and initializers are supported in LINQ to Entities
Please help