How to insert DbGeography to SQL Server using dapper
问题 I've created the model using System.Data.Entity.Spatial; public class Store { public int Id { get; private set; } public string Name { get; set; } public string Address { get; set; } public DbGeography Location { get; set; } } Inserting to DB using (SqlConnection conn = SqlHelper.GetOpenConnection()) { const string sql = "INSERT INTO Stores(Name, Address, Location) " + "VALUES (@Name, @Address, @Location)"; return conn.Execute(sql, store); } i get the exception type System.Data.Entity.Spatial