简体   繁体   English

Dapper支持空间类型.net核心

[英]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. 我知道dapper支持SqlGeography .net类型 - 但是,.net核心不支持。

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? 有没有办法我可以创建自己的SqlGeography类型(在我的情况下,我只需要一个点的lat和long值)并配置dapper来支持它? Is there a way to do it without modifying dapper's code like some examples I have seen? 有没有办法在不修改dapper的代码的情况下这样做,就像我看到的一些例子一样?

Dapper pre .Net Core was relying on EntityFramework SQL Types to support SQLGeography. Dapper pre .Net Core依赖于EntityFramework SQL Types来支持SQLGeography。

.Net Core does not support Spacial Types yet, there is an open issue here: https://github.com/aspnet/EntityFrameworkCore/issues/1100 .Net Core还不支持Spacial Types,这里有一个未解决的问题: 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 如果您查看最新评论,它似乎无法用于.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. 我有同样的问题,我最好的替代方案是暂时转换为2个字段(lat&lng)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM