Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7617963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:16:37+00:00 2026-05-31T03:16:37+00:00

So from what I read the Geography SQL type isn’t supported in the entity

  • 0

So from what I read the Geography SQL type isn’t supported in the entity framework yet.

I was wondering if anyone had a solution to a problem I’m having. I have a c# class that has some data access methods using the entity framework and LINQ.
These methods are getting GPS coordinates passed into them. The database (and entity framework types) have longitude and latitude fields on them which are populated when the rows are created. This all works fine.

What I want to do is to make my LINQ queries pull back rows that are near (within a radius) the given GPS coordinates. I don’t want to have to start using stored procs as this will be an architecture change.

Does anyone have any ideas on this? I’m struggling for ideas.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:16:39+00:00Added an answer on May 31, 2026 at 3:16 am

    If you want to take advantage of your database Spatial index (which will allow fast spatial queries), you should store your positions as Geography in your table (you can also keep the current latitude/longitude columns if you want to access to this values).

    As Entity Framework doesn’t support Geography types/functions for now, I’m afraid your only option is to write a stored procedure that internally calls STDistance (if you use SQL Server 2008 R2).

    Honestly, as the spatial functions actually depend on the database (STDistance is valid for SQL Server 2008 R2 only), it’s not a bad idea to have stored procedure for your particular use case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read from this article http://codahale.com/how-to-safely-store-a-password/ and it says using a salt isn't
I read from source.sql ( sql script ) file INSERT INTO `Tbl_abc` VALUES (1111,
My goal: To read the points from a Geography Polygon stored in my PostGIS
I'm trying to store some binary data obtained from read() in my buffer using
I read from some books that Phusion Passenger is the answer to easy Ruby
From what I've read from Herb Sutter and others you would think that volatile
History: I read from one of Knuth's algorithm book that first computers used the
I have read from some article that say's Apple doesn't approve the application which
I have read from the question How to gain access to a ServletContext instance
When I read from a csv file with fgetcsv method it removes Å and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.