The Entity Framework context generates queries for me.
var query = from c in context.Cities where c.CityID == 3 select c; var objectQuery=query as System.Data.Objects.ObjectQuery; Console.WriteLine(objectQuery.ToTraceString());
The following line is displayed here:
SELECT [Extent1].[CityID] AS [CityID], [Extent1].[geom] AS [geom], [Extent1].[Name] AS [Name], FROM [dbo].[Cities] AS [Extent1] WHERE 3 = [Extent1].[CityID]
My table contains a spatial column called geometry. Entity Framework does not contain geometric functions. For example, this is a geometric function:
SELECT ST_AREA(geom) FROM Cities WHERE CityID = 3
So, I could not use the context extension method as follows:
context.Cities.Where(....)
Perhaps, or is there any entity method for redefining geometric functions.
source share