EFMapper 1.0.0
dotnet add package EFMapper --version 1.0.0
NuGet\Install-Package EFMapper -Version 1.0.0
<PackageReference Include="EFMapper" Version="1.0.0" />
<PackageVersion Include="EFMapper" Version="1.0.0" />
<PackageReference Include="EFMapper" />
paket add EFMapper --version 1.0.0
#r "nuget: EFMapper, 1.0.0"
#:package EFMapper@1.0.0
#addin nuget:?package=EFMapper&version=1.0.0
#tool nuget:?package=EFMapper&version=1.0.0
EFMapper
A convention-based object-to-object mapper for .NET, hardened against recursion-based denial-of-service. EFMapper keeps the familiar AutoMapper 13.x API and call sites, so it can replace AutoMapper in existing applications with a package swap and a namespace change.
Why this fork exists
AutoMapper had three High-severity advisories for uncontrolled recursion (CWE-674). A deeply
nested object graph could exhaust the thread stack and throw an uncatchable
StackOverflowException, terminating the whole process:
| Advisory | CVE | What was wrong | Fix in EFMapper |
|---|---|---|---|
| GHSA-rvv3-g6hj-g44x | CVE-2026-32933 | No default depth limit for self-referential maps | A default MaxDepth of 64 is applied when recursion is detected |
| GHSA-gpwp-5797-mjff | CVE-2026-128081 | MaxDepth bypassed by derived maps, object/interface members, dictionary/dynamic sources and recursive type converters |
Derived maps inherit MaxDepth; every runtime map call checks the stack and throws a catchable InsufficientExecutionStackException |
| GHSA-6vhm-j9h7-f9gh | CVE-2026-128082 | Depth counted after the destination was constructed, so constructor parameters / positional records recursed without bound | Depth is counted before the destination is created |
These are defense-in-depth measures. Keep validating and bounding input depth at your application boundary as well.
Install
dotnet add package EFMapper
The NuGet package ID is EFMapper; the assembly and namespace are EFMapper.
Getting started
Configure the types to map at startup:
using EFMapper;
var configuration = new MapperConfiguration(cfg =>
{
cfg.CreateMap<Foo, FooDto>();
cfg.CreateMap<Bar, BarDto>();
});
// Only during development; remove before release.
#if DEBUG
configuration.AssertConfigurationIsValid();
#endif
// Or register with DI and resolve IMapper.
var mapper = configuration.CreateMapper();
Then map:
var fooDto = mapper.Map<FooDto>(foo);
var barDto = mapper.Map<BarDto>(bar);
Recursion and depth limits
When EFMapper detects a self-referential type map it enables PreserveReferences and applies a
default MaxDepth of 64 (the same default as System.Text.Json and Newtonsoft.Json).
If your graphs legitimately go deeper, raise the limit explicitly:
cfg.CreateMap<Node, NodeDto>().MaxDepth(128);
Constructor parameters and positional records honor the same limit. Recursion that cannot be
bounded by the type graph (dictionary/dynamic sources, object/interface members, recursive
type converters) fails with a catchable InsufficientExecutionStackException instead of
overflowing the stack.
Migrating from AutoMapper
- Replace the package reference
AutoMapperwithEFMapper. - Replace
using AutoMapper;withusing EFMapper;.
The public types (IMapper, MapperConfiguration, Profile, ProjectTo, the configuration
expressions) keep their names and signatures.
Compatibility
- Target framework:
net10.0(usable from .NET 10 and later). - API surface is kept aligned with AutoMapper 13.x.
License
MIT. This project is a fork of AutoMapper,
copyright (c) 2010 Jimmy Bogard, and retains the original MIT notice. See LICENSE.txt.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Microsoft.Extensions.Options (>= 10.0.0)
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 |
|---|---|---|
| 1.0.0 | 0 | 12/3/2026 |