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

The user may input the latitude and longitude of a specific spot on the map using a form I have. String values will be used to enter the data. I performed some investigation and discovered that the Entity Framework doesn't handle geographic data types from a number of sources.

  • How can I parse the textual data and/or store it to a database column for geography?
  • Once it is saved, how can I get it and reparse it as a string?

I appreciate it.

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

Accepted Answer

In actuality, spatial types are supported by Entity Framework 5 components that come with.NET Framework 4.5. Watch this walkthrough, please.

EDIT With EF6, spatial types are compatible with.NET Frameworks 4 and 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