Mittwoch, 14. März 2012 22:05
Raymond Saltrelli originally asked this question on the pre-release forums; moving it here for visibility:
"Is there any plan to add support for the new Entity Framework spatial types to WCF Data Services? It was really nice when they added them to EF in the June 2011 CTP so now I can manipulate them server side but I would also like to be able send some kind of representation to the client.
Is there a work around for this in the mean time? I tried to use the IgnoreProperties attribute on my Geometry property and add a GeometryAsBase64String property but apparently IgnoreProperties doesn't work with EF. What alternatives to EF do I have if I want to use spatial types with WCF Data Services?"
Mittwoch, 1. August 2012 21:32I guess we are alone in this world to try to make it work between EF 5 and WCF data service 5, im stucked with the fact that EF uses system.data.spatial.dbGeography and WCF only uses system.spatial.Geography... why is it so complicated to make it work between the two?
Mittwoch, 1. August 2012 22:37
Spatial types are supported in the WCF Data Services 5.0 release, please see http://msdn.microsoft.com/en-us/library/hh525394(VS.103).aspx
WCF Data Services Documentation Team
Donnerstag, 2. August 2012 13:24
As i mentioned, i am trying to get to work the tentity framework and WCF data services together right away. But as i mentionned, the entity framework use an abstract spatial type from dbgeography from system.data.spatial namespace (in .NETFramework\v4.5 \System.Data.Entity.dll) as a primitive type and WCF supports Geography in system.spatial namespace (in System.Spatial.dll from WCF data service 5 installed) primitives type. So they are not compatible. Unless there is something im missing here, i cannot drag a table im my edmx file with a geography type, then use my entity model for my DataService(Of ).
Is there any way to convert from one to the other?
Mittwoch, 29. August 2012 18:47Unfortunantly this is not a supported scenario. Entity Framework's and WCF Data Services' spatial implementations are not compatable. The EF provider for WCF DS does not recognize EF's spatial types. We'd like to add a bridge to support this, but this has not happened at this time.
I'm unaware of any pleasant workaround for this limitation at the moment, besides the custom provider approach (significant work, as you lose the out of box EF provider support).
- Als Antwort vorgeschlagen costea310d Mittwoch, 29. August 2012 18:57
Mittwoch, 26. September 2012 17:41
Any news on this topic? Seen from outside seems really incredible that EF and WCF Data Services are not compatible :(
Is there any release plan that include this feature?
Samstag, 10. November 2012 18:21
Yes it seems really incredible
No news about this?
Mittwoch, 14. November 2012 17:06
Is it correct that this issue is the reason for my current problem?:
I have a DB including a geography datatype. I try to setup a WCF Data Service as described here: http://msdn.microsoft.com/en-us/library/dd728275(v=vs.103).aspx . When I run the service I get an 'Request Error' response. When I remove the geography property, the service runs smoothly.
Is there really no workaround?
Does anybody know something more elegant than insering geography as WKT into the DB and converting it inside the DB? I was so much looking forward to this approach of exposing my Geodata as OData...
thanx for your answers,
Mittwoch, 3. April 2013 19:48Hi, I wrote a workarround about this. There is a paper on the topic you can get from the Odata team at MS. If they do not provide you with the doc, i will send it to you if still needed. Regards. Guillaume Pelletier
Freitag, 5. April 2013 16:21
Could you please provide the link for that doc. I am having the same issue and I have yet find a work around for it.