IRI.Maptor.Infrastructure.EfCore.SqlServer 3.0.0

dotnet add package IRI.Maptor.Infrastructure.EfCore.SqlServer --version 3.0.0
                    
NuGet\Install-Package IRI.Maptor.Infrastructure.EfCore.SqlServer -Version 3.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IRI.Maptor.Infrastructure.EfCore.SqlServer" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IRI.Maptor.Infrastructure.EfCore.SqlServer" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="IRI.Maptor.Infrastructure.EfCore.SqlServer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add IRI.Maptor.Infrastructure.EfCore.SqlServer --version 3.0.0
                    
#r "nuget: IRI.Maptor.Infrastructure.EfCore.SqlServer, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package IRI.Maptor.Infrastructure.EfCore.SqlServer@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=IRI.Maptor.Infrastructure.EfCore.SqlServer&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=IRI.Maptor.Infrastructure.EfCore.SqlServer&version=3.0.0
                    
Install as a Cake Tool

IRI.Maptor.Infrastructure.EfCore.SqlServer

NuGet Target

EF Core support for reading SQL Server spatial columns directly into IRI.Maptor Geometry<Point>. It is a drop-in replacement for UseNetTopologySuite() and removes the NetTopologySuite and Microsoft.SqlServer.Types dependencies from applications. Geometry is read and written in the SQL Server native binary (MS-SSCLRT) format by IRI.Maptor.Core.Spatial's SqlServerSpatialNativeBinary serializer, so no NTS objects or WKB conversion are involved.

The provider-neutral parts (MaptorGeometryValueComparer, ConfigureMaptorGeometry(), IsGeography() / IsGeometry()) live in IRI.Maptor.Infrastructure.EfCore, which this package references. The PostgreSQL/PostGIS counterpart is IRI.Maptor.Infrastructure.EfCore.PostgreSql.

Installation

dotnet add package IRI.Maptor.Infrastructure.EfCore.SqlServer

Features

  • A provider plugin for the SQL Server EF Core provider: UseMaptor() replaces UseNetTopologySuite()
  • Reads and writes geometry and geography columns (points, lines, polygons, multi-* and geometry collections; 2D)
  • SqlServerMaptorGeometryTypeMapping — the RelationalTypeMapping for Geometry<Point>
  • SqlServerSpatialPassThroughTypeMapping — a pass-through mapping for spatial columns in models compiled from migration snapshots and designer files (columns typed SqlBytes, or the legacy NetTopologySuite Geometry), so dotnet ef migrations add/remove keep working after switching from UseNetTopologySuite()
  • SqlServerMaptorGeometryTypeMappingSourcePlugin / SqlServerMaptorGeometryOptionsExtension — provider wiring

Usage

Enable the provider plugin where you configure the context (replaces x.UseNetTopologySuite()):

using IRI.Maptor.Infrastructure.EfCore.SqlServer.Extensions;

options.UseSqlServer(connectionString, x => x.UseMaptor());

Declare geometry properties on your entities as Geometry<Point>:

using IRI.Maptor.Core.Spatial.Primitives;
using IRI.Maptor.Core.Common.Primitives;

public Geometry<Point> SHAPE { get; set; }

To choose the column type, either set a default for all geometry properties in ConfigureConventions:

using IRI.Maptor.Infrastructure.EfCore.Extensions;

protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
    => configurationBuilder.ConfigureMaptorGeometry();          // maps Geometry<Point> -> geography

or set it per property in OnModelCreating:

entity.Property(e => e.SHAPE).IsGeography();   // or .IsGeometry()

If no column type is configured, Geometry<Point> defaults to geography.

Limitations

  • Z/M values are rejected with a clear error, so store 2D data. (The PostgreSQL plugin drops them instead.)
  • Server-side spatial operations go through raw SQL (FromSql / FromSqlRaw, e.g. SHAPE.STIntersects(...)). LINQ spatial method translation is intentionally not provided.

NuGet package · Report issues · Back to IRI.Maptor.Infrastructure

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 80 11/10/2026
3.0.0-alpha 103 10/29/2026