Spatial Registration in Entity Infrastructure

I want to write a join operator in LINQ using the dbgeography "Intersections" method (I use CTP EF June 2011). The problem is that I am writing something like this:

var joinQuery = from spQ in spatialTableQuery join mnQ in MainQuery on spQ.Polygon.Intersects(mnQ.PointGeography) equals 1 

I get the following error:

The name "mnQ" is not in the scope on the left side of "equals". Consider replacing expressions on either side of "equals."

In SQL, I wrote a similar query, as shown below, so I know that SQL supports it:

 SELECT * FROM Address a INNER JOIN SPATIALTABLE b WITH(INDEX(geog_sidx)) ON b.geom.STIntersects(a.PointGeography) = 1 
+4
source share
1 answer

Try something like this:

 var joinQuery = from spQ in spatialTableQuery from mnQ in MainQuery where spQ.Polygon.Intersects(mnQ.PointGeography) = 1 
+1
source

All Articles