I've found some related questions, but the author gave up and went ahead with using stored procedures to do the 'mapping'.
This is actually a continuation question from here
Model
public class Store
{
public int Id { get; private set; }
public string Name { get; set; }
public string Address { get; set; }
public DbGeography Location { get; set; }
}
Querying
using (SqlConnection conn = SqlHelper.GetOpenConnection())
{
const string sql = "Select * from Stores";
return conn.Query<Store>(sql, new { Tenant_Id = tenantId });
}
Dapper doesn't understand spatial data, and as many had said, it wasn't the authors original intention to support vendor specific implementations. But the documentation to extend the Query<T>
support is hard to find
GetValue
, and just assume it'll work). I'm willing to take a look at that, but: it isn't something that it does today. – BlackSqlCommand
/TdsParser
). No, there isn't currently an interface for custom parsing: that is all part of the "would need to be scoped, designed, written, tested, ..." – BlackSqlGeography
fromMicrosoft.SqlServer.Types.dll
? – Black