please comvert this code to linq. i have a problem with this in my linq code SELECT top 15 * FROM ( SELECT *, ( ( ( acos( sin((15.391861273433282 * pi() / 180)) * sin(( X * pi() / 180)) + cos((15.391861273433282 * pi() /180 )) * cos(( X * pi() / 180)) * cos(((121.05844856778678 - y) * pi()/180))) ) * 180/pi() ) * 60 * 1.1515 * 1.609344 ) as distance FROM table ) table WHERE distance <= 2
please comvert this code to linq. i have a problem with this in my linq code
using (DataContext phil= new DataContext()) { var ss= phil.table .ToList() //obligatory .Select(p => ((Math.Acos( Math.Sin((15.391861273433282 * Math.PI / 180.0)) * Math.Sin(( p.X * Math.PI / 180.0)) + Math.Cos((15.391861273433282 * Math.PI /180.0 )) * Math.Cos(( p.X * Math.PI / 180.0)) * Math.Cos(((121.05844856778678 - p.Y) * Math.PI/180.0))) * 180.0/Math.PI) * 60.0 * 1.1515 * 1.609344) ) .Where(d => d<20) .ToList(); return ss; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)