title: C# linq SqlGeography - find locations within 50m by Latitude and Longitude
body: <p>I have lat and long in a SQL DB stored as 'float'</p>
  
  <p>I'm trying the following where lat &amp; lng are C# double</p>
  
  <pre><code>var yourLocation = SqlGeography.Point(lat, lng, 4326);
  MyConn conn = new MyConn();
  var query = from p in conn.Locations
             let distance = SqlGeography
              .Point(p.Latitude, p.Longitude, 4326)
              .STDistance(yourLocation)
              .Value
               where distance &lt;= 50
  select p;
  return query.Distinct().ToList();
  </code></pre>
  
  <p>All I get is the following error</p>
  
  <p><em>LINQ to Entities does not recognize the method 'System.Data.SqlTypes.SqlDouble STDistance(Microsoft.SqlServer.Types.SqlGeography)' method, and this method cannot be translated into a store expression.</em></p>
  
  <p>Any thoughts on this ??</p>