Open lettucebo opened 5 years ago
Great question. Now that this exists, we should investigate.
I have implement one version for Entity Framework Core https://github.com/lettucebo/Dapper/tree/master/Dapper.EntityFrameworkCore
While I'm going to try is this out, I stuck at a strange point, saying it can't find Microsoft.SqlServer.Types
but I quite sure I never touch Microsoft.SqlServer.Types no matter from Dapper or my test project
And the exception message seems come from System.Data.SqlClient
:
FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.Types, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'. The system cannot find the file specified.
Need some help insight
Reference https://github.com/dotnet/SqlClient/issues/30#issuecomment-459540715
Thank you @lettucebo; great stuff.
Same issue here, setting the column type to Geography in MSSQL seems to instruct the System.Data.SqlClient to use SqlGeography type from Microsoft.SqlServer.Types only when reading.
Adding a reference to Microsoft.SqlServer.Types solves the error.
@michaelgregson
Yes, but I want to run my ASP.NET Core web application on Linux
Since Microsoft.SqlServer.Types is base on .NET Framework, so it might not work on Linux platform
I just bumped into this issue myself...
The member shape of type NetTopologySuite.Geometries.Geometry cannot be used as a parameter value
This would be wonderful if it worked...
For using Points as geography, I found this very simple mapper works with Npgsql:
SqlMapper.AddTypeHandler(typeof(Point), new SqlMapper.UdtTypeHandler("geography"));
Now EF Core support for spatial data begin from EF Core 2.2 and using NetTopologySuite as spatial data type base
Is there any plan for support NetTopologySuite Geometry data type?
https://docs.microsoft.com/en-us/ef/core/modeling/spatial