Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DbGeography support #8

Open
rogerfar opened this issue Sep 20, 2018 · 10 comments
Open

DbGeography support #8

rogerfar opened this issue Sep 20, 2018 · 10 comments
Assignees

Comments

@rogerfar
Copy link

I noticed that DbGeography is included in the library but when I run it I get:

Spatial types and functions are not available for this provider because the assembly 'Microsoft.SqlServer.Types' version 10 or higher could not be found

How would one go about installing/including Microsoft.SqlServer.Types in a .NET core project?

@JonathanMagnan JonathanMagnan self-assigned this Sep 20, 2018
@JonathanMagnan
Copy link
Member

Hello @farlock85 ,

Thank for reporting. We will look at how we can support Spatial for .NET Core project.

I believe the following library must be used: https://www.nuget.org/packages/Microsoft.Spatial/

We will investigate it during the weekend.

Best Regards,

Jonathan

@JonathanMagnan
Copy link
Member

Hello @farlock85 ,

It's something urgent?

On our side, we would prefer to wait until .NET Core 2.2 is released or the RC1 which should be out around the end of 2018.

The reason is that Microsoft is currently adding/improving spatial type in this version. It will be the first version that EF Core will support them.

We checked a few alternatives but we didn't like any of them and I don't think that implementing our own version of SqlServer.Types is the way to go.

Let me know if that's something you really need, we might perhaps already look at it even if it's a preview stage.

Best Regards,

Jonathan

@rogerfar
Copy link
Author

rogerfar commented Oct 3, 2018

Hi Johathan,

I've been following the spatial stuff from .NET core 2.2 myself, I think we can wait, but will this solve the issue with EFClassic?

@JonathanMagnan
Copy link
Member

Yes and no,

The problem is we might use some internal method to make it work. From past experience, preview version are not always close to the final version and some if these internal methods still change from time to time which makes our code crash.

We can probably already start to look at it this month instead of waiting to make sure everything will work. Perhaps we will find out that we can already release something compatible.

@JonathanMagnan
Copy link
Member

Hello @farlock85 ,

We are currently re-visiting some issue.

Are you using .NET Core on Windows or on Linux(or another OS)

If you are using .NET Core on Windows, one way to simply solve this issue is to reference the NuGet: https://www.nuget.org/packages/Microsoft.SqlServer.Types/

It will work for Windows but not in other OS.

There is currently a couple of unofficial Microsoft.SqlServer.Types that support .NET Standard since the last time we checked, we will investigate them.

@jonedmiston
Copy link

Any update on this? We’d love to run on Linux, but would need spatial support.

@JonathanMagnan
Copy link
Member

Hello @jonedmiston ,

To be honest, there is no good news about this request.

Since the source of Microsoft.SqlServer.Types is not open source, it makes very hard and very long to do this request. Even the Microsoft team doesn't plan to support it on their EF6 version that supports .NET Standard.

@jonedmiston
Copy link

Thanks for responding. Microsoft not supporting it in EF6.3 cross platform is what made your solution intriguing, but I understand the complexity. I'll keep following this issue in case anything changes.

@jonedmiston
Copy link

Don't mean to bother,but I was reading a bit about how Microsoft added spatial capabilities to EF Core using the NetTopologySuite package. They discuss it here a bit.

Not sure if this would help you flesh out this as a feature. I think having a portable EF6 option would be very helpful and it seems like Microsoft isn't going to be doing the work on that. We're an open source project so hopefully if you add it it will be part of this project so we could use it.

Thanks for all of your contributions to open-source! We use several of them.

@JonathanMagnan
Copy link
Member

Hello @jonedmiston ,

From what I know, Microsoft doesn't plan to add support to spatial types for EF6 (for .NET Standard).

However, the NetTopologySuite has already been added in EF Core.

We will for sure re-investigate it when time permits since it will allow our library to offer a feature that maybe EF6 for .NET Standard will never support.

We already have some idea in mind that could maybe work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants