none
Entity Framework did not include Geography type field RRS feed

  • Question

  • I have a entity model that I need to pull a table into that has a field with a "Geography" type, but that field is being omitted...how can I include this field with this type.
    • Moved by CoolDadTx Tuesday, June 11, 2013 5:13 PM EF related
    Tuesday, June 11, 2013 5:11 PM

Answers

  • Hi T junky;

    Make sure that the target .Net Framework for the project is .Net Framework 4.5 and is NOT using 4.0.

    You can find this info in the Project Property page .

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by T junky Monday, June 17, 2013 1:51 PM
    Tuesday, June 11, 2013 6:24 PM

All replies

  • Hi,

    Which version are you using ? AFAIK EF 5 should have support for that : http://www.itorian.com/2012/10/spatial-data-type-support-code-first-in.html


    Please always mark whatever response solved your issue so that the thread is properly marked as "Answered".

    Tuesday, June 11, 2013 5:20 PM
  • Thanks for your response...yes I'm not sure what AFAIK is but I do have EF 5.0 installed.
    Tuesday, June 11, 2013 6:22 PM
  • Hi T junky;

    Make sure that the target .Net Framework for the project is .Net Framework 4.5 and is NOT using 4.0.

    You can find this info in the Project Property page .

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by T junky Monday, June 17, 2013 1:51 PM
    Tuesday, June 11, 2013 6:24 PM
  • AFAIK means "As Far As I Know". As suggested by Fernando, note that this is available only when targeting .NET 4.5

    If I remember EF6 (which is currently an alpha release) was supposed to add support for those types even when using .NET 4 (not sure if this is still part of the plan).

    Seems still current. According to http://entityframework.codeplex.com/wikipage?title=Roadmap :

    Enums, Spatial and Better Performance on .NET 4.0 - By moving the core components that used to be in the .NET Framework into the EF NuGet package we are now able to offer enum support, spatial data types and the performance improvements from EF5 on .NET 4.0.


    Please always mark whatever response solved your issue so that the thread is properly marked as "Answered".


    Wednesday, June 12, 2013 9:30 AM