Search code examples
sql-serverentity-framework-coresqlgeometry

SqlGeometry in Entity Framework Core


I'm trying to work with Entity Framework Core against a SQL Server database.

I've got a test class (based on Microsoft's demo 'blog/post' sample code) which I migrate to a SQL Server database.

I want to add a member to my test class which will save as a SqlGeometry column and allow me to read/write that data.

It doesn't seem that there is an appropriate geometry type in Entity Framework/ .NET Core - so how should I approach the problem?


Solution

  • You can see a workaround here, which will enable you to use this unsupported data type: https://github.com/aspnet/EntityFramework/issues/1100#issuecomment-286362657