-
-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessing DbGeography methods/properties #134
Comments
It will take me a bit to build some proper tests around it, but I added the following to the predefined types, and the above queries appear to be translating to proper TSQL now. _predefinedTypesHelper.TryAdd("System.Data.Entity.Spatial.DbGeography, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 2); Once I've had a chance to test some more I'll create a pull request for this. @StefH thanks for your prior tip on getting the solution to properly build. Turns out it came in handy. |
All right, testing was successful. I added a pull request. |
Thanks a lot! |
Wow, I see you created a new release already. Thanks! |
You are welcome! |
I am now working on querying some fields that are mapped via Entity Framework to the Sql Server geography type. The following two queries:
queryable.Where("p.any(c.geographic.Union(@0).Area == 0)", parameters.ToArray());
queryable.Where("p.any(@0.Difference(c.geographic).IsEmpty)", parameters.ToArray());
result in the following error:
System.Linq.Dynamic.Core.Exceptions.ParseException: 'Methods on type 'DbGeography' are not accessible'
A simple geographic query, like the following, works as expected:
p.any(c.geographic.Intersects(@0))
The parameters object contains a single DbGeography object.
Are the above two queries expected to work? Do I maybe again have the incorrect query syntax?
Thanks!
The text was updated successfully, but these errors were encountered: