Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dapper Support Spatial Types .net Core

I have a table with a geography column. I Know dapper supports SqlGeography .net type - However, .net core doesn't.

Is there a way I could create my own SqlGeography type (in my case I just need the lat and long values of a point at the moment) and configure dapper to support it? Is there a way to do it without modifying dapper's code like some examples I have seen?

like image 916
gilmishal Avatar asked Feb 12 '17 17:02

gilmishal


1 Answers

Dapper pre .Net Core was relying on EntityFramework SQL Types to support SQLGeography.

.Net Core does not support Spacial Types yet, there is an open issue here: https://github.com/aspnet/EntityFrameworkCore/issues/1100

If you look at the latest comments, it seems it won't be available for .Net Core 2.1

I have the same issue, and my best alternative is to convert to 2 fields (lat & lng) for the time being.

like image 125
Tomap Avatar answered Oct 06 '22 01:10

Tomap