如何在EF中使用空间类型?

时间:2012-05-13 02:03:25

标签: entity-framework types spatial

我有一个带有SQL Geometry列的表。现在我正在尝试使用EF,但映射器不想包含它(现在应该支持它,as I saw here)。另外,我在EF Designer as I saw here中找不到空间类型。

到目前为止我已经完成了:

PM> Install-Package EntityFramework –IncludePrerelease
'EntityFramework 5.0.0-beta2' already installed.
MyProject already has a reference to 'EntityFramework 5.0.0-beta2'.

之后,引用的EnitiyFramework.dll版本为:

4.4.0.0

1 个答案:

答案 0 :(得分:1)

可悲的是,如果你的目标是.net 4,那就行不通了:Some features are only available when writing an application that targets .NET 4.5. This includes enum support, spatial data types, table-valued functions and the performance improvements. If you are targeting .NET 4.0 you still get all the bug fixes and other minor improvements. 来源:http://blogs.msdn.com/b/adonet/archive/2012/03/22/ef5-beta-2-available-on-nuget.aspx

此外,如果您的目标是4.5,请查看此处:How to get enums working in mvc4 with Entity Framework 5 Beta 2?