How can I use C#, Entity Framework, and SQL Server 2008 to read and write geographic data?

c# entity-framework geography gis sql-server-2008

Question

I have a form from which the user will be able to enter the latitude and longitude of a certain point on the map. The data will be input as string values. I did some research and found out from various sources that the Entity Framework doesn't support geography data types.

  • How can I parse and/or save the string data to a geography column in a database?
  • How can I access it and reparse it as string once it is stored?

Thanks in advance!

1
15
5/18/2012 3:54:01 PM

Accepted Answer

In fact Entity Framework 5 components that are shipped with .NET Framework 4.5 do support spatial types. Take a look at this walkthrough.

EDIT With EF6 you can use spatial types on both .NET Framework 4 and .NET Framework 4.5

20
5/7/2014 2:40:13 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow