Spatial Data (geography) not automatically added in Edmx

Spatial Data (geography) not automatically added in Edmx

I had to add geography data type in one of my stored procedure and pull this in visual studio using entity framework (EF). Unfortunately this was not add automatically.

For normal datatype like string, date, integer this not a problem.

To manually add this in visual studio.

  1. Click on edmx files. Do a right click and choose modal browser
  2. AddModalBrowserGoto Modal Browser -> click under complex types.  Choose scalar property and add Geography
  3. AddGeographyFieldMake sure name as same as in storage procedure. In my case It was geolocation
  4. Run your stored procedure and it should be able to populate the data


Leave a Reply

Your email address will not be published. Required fields are marked *