Wednesday, March 14, 2012 10:05 PM
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?"
Wednesday, August 01, 2012 9:32 PMI 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?
Wednesday, August 01, 2012 10:37 PM
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
Thursday, August 02, 2012 1:24 PM
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?
Wednesday, August 29, 2012 6:47 PMUnfortunantly 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).
- Proposed As Answer by costea310d Wednesday, August 29, 2012 6:57 PM
Wednesday, September 26, 2012 5:41 PM
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?
Saturday, November 10, 2012 6:21 PM
Yes it seems really incredible
No news about this?
Wednesday, November 14, 2012 5:06 PM
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,
Wednesday, April 03, 2013 7:48 PMHi, 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
Friday, April 05, 2013 4:21 PM
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.