EF5, SQL Server, Longitude and Latitude

后端 未结 4 911
误落风尘
误落风尘 2021-02-13 17:57

I found that the best type to store lat and long in SQL Server is decimal (9,6) (ref. What datatype to use when storing latitude and longitude data in SQL databases?) and so I d

4条回答
  •  Happy的楠姐
    2021-02-13 18:42

    You can use DbGeography type for storing Latitude and Longitude.

    using System.Data.Entity.Spatial;
    
    public class Test
    {
        public DbGeography Location { get; set; }
    }
    

提交回复
热议问题