IRI.Maptor.Infrastructure.EfCore
3.0.0
dotnet add package IRI.Maptor.Infrastructure.EfCore --version 3.0.0
NuGet\Install-Package IRI.Maptor.Infrastructure.EfCore -Version 3.0.0
<PackageReference Include="IRI.Maptor.Infrastructure.EfCore" Version="3.0.0" />
<PackageVersion Include="IRI.Maptor.Infrastructure.EfCore" Version="3.0.0" />
<PackageReference Include="IRI.Maptor.Infrastructure.EfCore" />
paket add IRI.Maptor.Infrastructure.EfCore --version 3.0.0
#r "nuget: IRI.Maptor.Infrastructure.EfCore, 3.0.0"
#:package IRI.Maptor.Infrastructure.EfCore@3.0.0
#addin nuget:?package=IRI.Maptor.Infrastructure.EfCore&version=3.0.0
#tool nuget:?package=IRI.Maptor.Infrastructure.EfCore&version=3.0.0
IRI.Maptor.Infrastructure.EfCore
EF Core persistence support for materializing SQL Server spatial columns directly into
IRI.Maptor Geometry<Point> — a drop-in replacement for UseNetTopologySuite() that removes the
NetTopologySuite and Microsoft.SqlServer.Types dependencies from applications. Geometry is
read/written using the SQL Server native binary (MS-SSCLRT) format via IRI.Maptor.Core.Spatial's
SqlServerSpatialNativeBinary serializer, so no NTS object graph or WKB round-trip is involved.
Installation
dotnet add package IRI.Maptor.Infrastructure.EfCore
Features
- Provider plugin for the SQL Server EF Core provider:
UseMaptorGeometry()replacesUseNetTopologySuite() - Reads/writes
geometryandgeographycolumns (points, lines, polygons, multi-* and geometry collections; 2D) SqlServerMaptorGeometryTypeMapping— theRelationalTypeMappingforGeometry<Point>SqlServerSpatialPassThroughTypeMapping— pass-through mapping for spatial columns in models compiled from migration snapshots/designers (SqlBytesprovider-typed, or legacy NetTopologySuiteGeometry), sodotnet ef migrations add/removekeep working after switching fromUseNetTopologySuite()SqlServerMaptorGeometryTypeMappingSourcePlugin/SqlServerMaptorGeometryOptionsExtension— provider wiringMaptorGeometryValueComparer— reusable change-tracking comparer (SRID + WKB)ConfigureMaptorGeometry()convention and per-propertyIsGeography()/IsGeometry()configuration
Usage
Enable the provider plugin where you configure the context (replaces x.UseNetTopologySuite()):
options.UseSqlServer(connectionString, x => x.UseMaptorGeometry());
Declare geometry properties on your entities using Geometry<Point>:
using IRI.Maptor.Core.Spatial.Primitives;
using IRI.Maptor.Core.Common.Primitives;
public Geometry<Point> SHAPE { get; set; }
Choose the column type — either set a default for all geometry properties in
ConfigureConventions:
protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
=> configurationBuilder.ConfigureMaptorGeometry(); // maps Geometry<Point> -> geography
or 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 columns are rejected with a clear error — store 2D data.
- Server-side spatial operators are expected via 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 | Versions 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. |
-
net8.0
- IRI.Maptor.Core.Spatial (>= 3.0.0)
- Microsoft.EntityFrameworkCore.SqlServer (>= 9.0.2)
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 | 96 | 8/23/2026 |
| 3.0.0-alpha | 95 | 8/22/2026 |