Microsoft SQL Server has a hierarchyid data type defined since SQL Server 2008. In the .NET Framework there is a nuget to support using the SqlHierarchyId struct: Microsoft.SqlServer.Types. Unfortunately that nuget is built for the .NET Framework and not .NET Core. If you add that nuget to a .NET Core project, the following compiler warning is produced:
Warning NU1701 Package 'Microsoft.SqlServer.Types 14.0.1016.290' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
There should be an implementation of SqlHierarchyId for .NET Core.
I tried using the Microsoft.Data.SqlClient nuget, but that does not have the SqlHierarchyId defined.
My current workaround is to use the dotMarten.Microsoft.SqlServer.Types nuget.
Related issues (which I don't think cover this same problem):
Microsoft SQL Server has a hierarchyid data type defined since SQL Server 2008. In the .NET Framework there is a nuget to support using the SqlHierarchyId struct: Microsoft.SqlServer.Types. Unfortunately that nuget is built for the .NET Framework and not .NET Core. If you add that nuget to a .NET Core project, the following compiler warning is produced:
There should be an implementation of SqlHierarchyId for .NET Core.
I tried using the Microsoft.Data.SqlClient nuget, but that does not have the SqlHierarchyId defined.
My current workaround is to use the dotMarten.Microsoft.SqlServer.Types nuget.
Related issues (which I don't think cover this same problem):