this is the json result of calculate distance from current position to another placess in the list but i have a issue i can't convert distance unit (degree) to km from dbgeography.location.distance this is my code :
string CurrentLocation = String.Format("POINT(" + CurrentLat + " " + CurrentLng + ")", 4326);
DbGeography point = DbGeography.PointFromText(CurrentLocation, DbGeography.DefaultCoordinateSystemId);
var places = (from u in context.schoolinfo
orderby u.Location.Distance(point.Buffer(dist))
select u).Take(10).Select(x => new schoollinfo() { Name = x.name, Lat = x.Location.Latitude, Lng = x.Location.Longitude, Distance = x.Location.Distance(point.Buffer(dist)) }); ;
var nearschools = places.ToList();
return Json(nearschools, JsonRequestBehavior.AllowGet);