I am preparing some spatial examples and decided to give Dapper, although EF has spatial support and I like to control my SQL again (thanks to Sam and Mark).
However, I need to have POCO supporting the DbGeography class. For instance:
public class BuriedTreasure {
public int PirateId { get; set; }
public DbGeography MarksTheSpot { get; set; }
}
My google foo let me go and the closest match I can find is this question, although it is only intended to add spatial support as a parameter (so this is 50%).
Now, as far as I can tell, I am limited to the following options, which for me are not a viable solution.
- Configure dapper code to understand SQL Server specific type
- Specify LONG, LAT, and ELEVATION decimal numbers in my POCO and create a SPATIAL type in my stored procedure and ask for another procedure to get the values (or use a constant computed column, but it's almost the same)
Alternatives?
source
share