locked
The property 'geom' on type 'soluri_DBO_sol' is of type 'Geometry' which is not a supported primitive type RRS feed

  • Question

  • What am I doing wrong? What am I missing?
    1) I am Using SQL Server 2012 as the raw data repository
    2) I am Using ADO.NET Entity Framework data model as the data connector
    3) I am Using WCF Data Service as the data publishing interface.
    What happens:
    If I delete the geometry column from the edmx(which was generated from a SqlServer2012 database), all is fine; if I keep it, can't add service reference, can't browse the svc file. The error I get (from web_tracelog.svclog) is:

          The property 'geom' on type 'soluri_DBO_sol' is of type 'Geometry' which is not a supported primitive type

    (I have VS2012, EntityFramework version 5, OData version5:) Here's the packages.config content:

    <?xml version="1.0" encoding="utf-8"?>
    <packages>
    <package id="EntityFramework" version="5.0.0" targetFramework="net45" />
    <package id="Microsoft.Data.Edm" version="5.0.0" targetFramework="net45" />
    <package id="Microsoft.Data.OData" version="5.0.0" targetFramework="net45" />
    <package id="Microsoft.Data.Services" version="5.0.0" targetFramework="net45" />
    <package id="Microsoft.Data.Services.Client" version="5.0.0" targetFramework="net45" />
    <package id="System.Spatial" version="5.0.0" targetFramework="net45" />
    </packages>

    Tuesday, August 28, 2012 8:13 AM

Answers

  • 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).

    Sorry for any inconvenience.

    -Ian

    • Marked as answer by costea310d Wednesday, August 29, 2012 6:55 PM
    Wednesday, August 29, 2012 6:48 PM

All replies

  • 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).

    Sorry for any inconvenience.

    -Ian

    • Marked as answer by costea310d Wednesday, August 29, 2012 6:55 PM
    Wednesday, August 29, 2012 6:48 PM
  • this is THE answer for my gut feeling, that I was hoping for.
    Wednesday, August 29, 2012 7:10 PM
  • hi guys, I have the same problem of costea, but, I do not want to expose the entitys with spatial properties.

    There is a way to disable that entitys from processing?

    Thursday, February 21, 2013 12:00 PM