Поделиться через


Spatial Types in the Entity Designer

One of the highly-anticipated features coming in the next version of Entity Framework is Spatial support. We’d like to give you a look at the experience of developing with Spatial types in the Entity Designer. If you haven’t already, take a look at what is going on under the hood with Spatial types in the Entity Framework in the blog post here

We’d like to show you what is coming your way for Spatial types in the Entity Designer and of course, let us know what you think and give us feedback on the experience!

Goals

The goals for supporting Spatial types in the Entity Designer align with Entity Framework design goals for Spatial as well:

  • First class support for Spatial types in the Entity Designer
  • Model-first and Database-first support through the Entity Designer

Spatial Types

  • Geometry
  • Geography

Experience

Since the Entity Framework adds Spatial types as primitive EDM types, we treat them exactly as you are used to using primitive types in the Entity Designer.

  1. Add Property to Entity Type
  2. Set Data Type as Geography through the Property Window

 

 

 

 

Restrictions

Spatial types cannot be used as entity keys, in associations, or as discriminators. We give design-time validation errors if you attempt to use one of those invalid patterns.

 

  1. Attempt to set property of type Geometry as entity key
  2. Validation error in Error List

 

 

Feedback

As always, please let us know what is most valuable to you in the Entity Designer for using Spatial data types. Feedback is always appreciated!

 

 

Thank you,

Sarah McDevitt

Program Manager

Comments

  • Anonymous
    May 12, 2011
    What did you mean with "Next version of Entity Framework"? 4.2 or I will need to wait for .NET 5?

  • Anonymous
    May 18, 2011
    Great! And will the hierarchyid-datatype also supported in the next release?

  • Anonymous
    May 19, 2011
    What about XML datatypes?

  • Anonymous
    June 21, 2011
    Yes, I would like to know the same thing. Are we talking 4.2?

  • Anonymous
    June 30, 2011
    @Fujiy and @Jan: I think we're talking .NET 4.5. The devs always said that they needed framework changes to support Enums and if you build a sample application with this CTP then you need to target a different version of the framework. I'm assuming the next version of the framework will be .NET 4.5 from the Windows 8 leaks i've read about. I'm sure we'll know more after Build.

  • Anonymous
    October 15, 2011
    This is a great boost . . However a post with a Filestream varbinary(max) and Sql geography would be worth considering

  • Anonymous
    October 17, 2011
    Great to see the spatial support!  I am writing a Bing Map application (not a Bing Map App) in Silverlight 4 and I'm curious to know how the spatial data types can be converted into MapPolygon, MapPolyLine, and Multi-polyling/polygon types. In a perfect world, the Add() method of BingMap (Silverlight) would accept/draw these new EF spatial types.  For instance MapLayer.Add(new MapPolygon(dbContect.myGeometry as LocationCollection));  or something to that effect.  (My code currently spins through a text field that contains lat/long locations in a column (a geometry column is the next column in the database and I would much rather use the geometry column and avoid text spinning.:D ) What does the Bing Maps team think about the new spatial support? Thoughts? Thanks again and great job adding spatial support! Mike

  • Anonymous
    October 22, 2011
    I have developing a web app based on Spatial Data . But since i am moving to EF for easy CRUD functionality  I am Stuck . I even Downloaded the EF june 2011CTP but still it shows the error like"Error 0040: Type Geography is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualifification" where my Photo Location is equiped with a Geography location. ..............When will this be available .........Any Help regarding Spatial Data and FileStream varbinary(max) Column would be highly appreciated

  • Anonymous
    November 01, 2011
    Just checked VS 11 on Win8, no geography support there. I also wonder when this feature will be released. VS 2010 SP2?

  • Anonymous
    November 17, 2011
    Hello, After reading this aricle and watch this video channel9.msdn.com/.../SAC-812T, I can't wait  any longer to test Spatial Data with my WCF Data Services ! :) But in the What's new in .Net 4.5 page there is nothing about new features in EF. Is Spatial Data will come with .Net 4.5 ? Thanks, Ben

  • Anonymous
    February 22, 2012
    So cool to have GeoGraphy support. Just have a Map project. Can't wait .net 4.5!! Cheers

  • Anonymous
    July 25, 2013
    i like it