EricksonLopez.Mapper
dotnet-mapper · Mapping & Serialization
On this page (20 sections)
1. Identity, Tier & Maturity Profile#
2. Value Proposition & Problem Solved#
High-performance, compile-time, reflection-free, Native AOT object mapping ecosystem for modern .NET, powered by Roslyn Incremental Source Generators.
Runtime-reflection mappers incur JIT warm-up overhead, trigger IL2026/IL3050 trimming errors under Native AOT, and bypass DDD constructors or factory invariants.
3. Quick Install#
Primary package: EricksonLopez.Mapper
dotnet add package EricksonLopez.Mapper --version 2.0.0<PackageReference Include="EricksonLopez.Mapper" Version="2.0.0" /><PackageVersion Include="EricksonLopez.Mapper" Version="2.0.0" />4. Verified Ecosystem Metrics#
Snapshot retrieved UTC: 2026-12-01
5. When to Use & When Not to Use#
When to use
- You want compile-time generated C# mappings verified by Roslyn analyzers (ELM001–ELM018) with StrongId and Result<T> support.
When NOT to use
- You rely strictly on dynamic runtime-configured projection rules that cannot be expressed as compile-time types.
6. Core Capabilities & Design Invariants#
Zero-Reflection Source Generation
Emits readable compile-time mapping methods without System.Reflection or Activator on core paths.
DDD & Result Adapters
Supports [MapFactory], [MapIgnore], [MapDerivedType], ValueObject unwrap/wrap, and ResultMappingExtensions.
7. Included NuGet Packages & Adapters#
| Package ID | Status | NuGet / Local | TFMs | AOT Status | Downloads | Description |
|---|---|---|---|---|---|---|
| EricksonLopez.MapperPrimary | Published | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 466 | Package Description |
| EricksonLopez.Mapper.Abstractions | Published | v2.0.0 / v3.0.0 | netstandard2.0, net8.0, net9.0, net10.0 | AOT: Full | 458 | Package Description |
| EricksonLopez.Mapper.DomainPrimitives | Published | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 271 | DomainPrimitives integration for EricksonLopez.Mapper. Enables mapping strongly-typed IDs and value objects to and from primitive types. |
| EricksonLopez.Mapper.Mapster | Published | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Incompatible | 270 | Mapster integration adapter for EricksonLopez.Mapper. Bridges Mapster's configuration and runtime adapter engine with the unified EricksonLopez.Mapper abstraction contracts. |
| EricksonLopez.Mapper.Result | Published | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 263 | Result monad mapping extensions for EricksonLopez.Mapper. Enables functional projection of Result<T> and collections. |
| EricksonLopez.Mapper.GeneratorAnalyzer / Generator | Published | v2.0.0 / v3.0.0 | netstandard2.0 | AOT: N/A (Analyzer/Legacy) | 334 | Package Description |
| EricksonLopez.Mapper.AnalyzersAnalyzer / Generator | Published | v2.0.0 / v3.0.0 | netstandard2.0 | AOT: N/A (Analyzer/Legacy) | 268 | Package Description |
8. Quick Start Code Example#
Grounded in verified public APIs from EricksonLopez.Mapper. Compile with `<ImplicitUsings>disable</ImplicitUsings>` and explicit imports.
using System;
using EricksonLopez.Mapper;
public sealed record OrderEntity(Guid Id, decimal TotalAmount);
public sealed record OrderSummaryDto(Guid Id, decimal TotalAmount);
[Mapper]
public static partial class OrderMapper
{
public static partial OrderSummaryDto ToDto(OrderEntity source);
}9. Architecture & Dependency Flow#
Rendering diagram…
flowchart LR lib_mapper["EricksonLopez.Mapper (L2)"] lib_domain_primitives["EricksonLopez.DomainPrimitives (L0)"] lib_mapper --> lib_domain_primitives lib_result["EricksonLopez.Result (L0)"] lib_mapper -.-> lib_result
View accessible text summary and structure
2 upstream library dependencies and 0 downstream dependent libraries verified in dependencies.json.
| Direction | Library | Tier | Relationship Kinds |
|---|---|---|---|
| Upstream | EricksonLopez.DomainPrimitives | L0 | Compile-Time, NuGet Package |
| Upstream | EricksonLopez.Result | L0 | Adapter, NuGet Package |
flowchart LR
lib_mapper["EricksonLopez.Mapper (L2)"]
lib_domain_primitives["EricksonLopez.DomainPrimitives (L0)"]
lib_mapper --> lib_domain_primitives
lib_result["EricksonLopez.Result (L0)"]
lib_mapper -.-> lib_result10. Target Frameworks & Native AOT / Trimming Matrix#
MSBuild `.csproj` inspection across 7 packages: 4 Full, 0 Partial, 1 Incompatible, 2 NotApplicable (analyzers/generators).
| Package ID | IsAotCompatible | EnableTrimAnalyzer | Verified AOT Status | Target Frameworks |
|---|---|---|---|---|
| EricksonLopez.Mapper | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Mapper.Abstractions | true | true | Full | netstandard2.0, net8.0, net9.0, net10.0 |
| EricksonLopez.Mapper.DomainPrimitives | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Mapper.Mapster | false | true | Incompatible | net8.0, net9.0, net10.0 |
| EricksonLopez.Mapper.Result | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Mapper.Generator | false | null | NotApplicable | netstandard2.0 |
| EricksonLopez.Mapper.Analyzers | false | null | NotApplicable | netstandard2.0 |
11. Upstream Dependencies & Downstream Dependents#
Upstream Dependencies (2)
Downstream Dependents (0)
No other EricksonLopez.* libraries currently depend on this family.
12. Optional Adapters & Third-Party Integrations#
Internal Adapter Edges & Integration Packages
- EricksonLopez.Mapper.Result→ EricksonLopez.Result (EricksonLopez.Result)
Verified External NuGet Dependencies (6)
13. Configuration & DI Registration Summary#
Verified DI & Configuration Entry Points
MapsterMapperExtensions.UseConverter<TSource, TDestination>Configures a `TypeAdapterConfig` instance to use the specified `IConverter<TSource, TDestination>` for mapping.
ResultMappingExtensions.MapAsync<TSource, TDest>Projects the success value of an asynchronous `Result<T>` task using the specified mapping delegate.
ResultMappingExtensions.MapList<TSource, TDest>Projects a sequence of items contained in a successful `Result<T>` into a read-only list of `TDest`.
Key Public Types & Contracts
EricksonLopez.Mapper.EnumMappingStrategy (enum)Specifies the strategy used to map enumeration values between source and destination enum types.
EricksonLopez.Mapper.EnumMappingStrategyAttribute (class)Configures the enum mapping strategy and case-sensitivity for an annotated mapper class, interface, or method.
EricksonLopez.Mapper.GenerateMapperRegistrationAttribute (class)Instructs the source generator to emit Microsoft.Extensions.DependencyInjection extension methods registering all non-static mappers.
EricksonLopez.Mapper.IConverter`2 (interface)Defines a custom converter that maps a source instance to a destination instance.
EricksonLopez.Mapper.MapDerivedTypeAttribute (class)Registers a runtime derived type pair for polymorphic dispatch in the generated mapping method.
EricksonLopez.Mapper.MapEnumValueAttribute (class)Maps a specific source enum member value to an explicit destination enum member value.
EricksonLopez.Mapper.MapFactoryAttribute (class)Instructs the source generator to instantiate the destination type using a static factory method instead of a constructor.
EricksonLopez.Mapper.MapIgnoreAttribute (class)Specifies that a destination member is excluded from automatic mapping, suppressing strict mapping diagnostics.
EricksonLopez.Mapper.MapIgnoreSourceAttribute (class)Specifies that a source member is excluded from member resolution during mapping generation.
EricksonLopez.Mapper.MapNullFallbackAttribute (class)Specifies a fallback expression to substitute when a nullable source member evaluates to `null` for a non-nullable destination member.
EricksonLopez.Mapper.MapPropertyAttribute (class)Configures an explicit member-to-member mapping between source and destination properties with differing names.
EricksonLopez.Mapper.MapValueAttribute (class)Assigns a constant value or custom C# expression directly to a destination member during mapping.
14. Verified Performance Benchmarks#
All verified measurements below come strictly from `BenchmarkDotNet.Artifacts` running on .NET RyuJIT (0 NativeAOT benchmark runs exist in this snapshot).
| Suite | Method | Runtime | Mean (ns) | Allocated (B) | Status |
|---|---|---|---|---|---|
| MappingBenchmarks | Generator_Poco | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 2.798 | 32 | measured |
| MappingBenchmarks | Mapperly_Poco | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 2.799 | 32 | measured |
| MappingBenchmarks | Manual_Poco | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 2.909 | 32 | measured |
| ValueObjectBenchmarks | Manual_ValueObjects | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 3.025 | 56 | measured |
| ValueObjectBenchmarks | Mapperly_ValueObjects | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 3.149 | 56 | measured |
| ValueObjectBenchmarks | Generator_ValueObjects | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 3.206 | 56 | measured |
| MappingBenchmarks | Mapster_Poco | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 8.442 | 32 | measured |
| ValueObjectBenchmarks | Mapster_ValueObjects | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 8.874 | 56 | measured |
| MappingBenchmarks | MapperlyMapping | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 16.06 | 192 | measured |
| MappingBenchmarks | GeneratorMapping | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 16.13 | 192 | measured |
| MappingBenchmarks | Mapperly_Complex | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 17.239 | 200 | measured |
| MappingBenchmarks | Generator_Complex | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 17.363 | 200 | measured |
| PolymorphicBenchmarks | Manual_Polymorphic | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 21.35 | 184 | measured |
| PolymorphicBenchmarks | Generator_Polymorphic | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 22 | 184 | measured |
| MappingBenchmarks | AutoMapper_Poco | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 24.904 | 32 | measured |
| PolymorphicBenchmarks | Mapperly_Polymorphic | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 27.57 | 184 | measured |
| MappingBenchmarks | MapsterMapping | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 1,274.19 | 8,248 | measured |
| MappingBenchmarks | Mapster_Complex | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 1,282.345 | 8,256 | measured |
| MappingBenchmarks | ManualMapping | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 1,454.29 | 8,248 | measured |
| MappingBenchmarks | Manual_Complex | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 1,482.34 | 8,256 | measured |
| MappingBenchmarks | AutoMapperMapping | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 3,510.07 | 16,792 | measured |
| MappingBenchmarks | AutoMapper_Complex | .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI | 3,569.344 | 16,800 | measured |
15. Release History & NuGet vs Repo Status#
Version lag detected: NuGet.org latest published version is v2.0.0, while local repository HEAD is at v3.0.0.
| Version | Source | Published Date | Summary |
|---|---|---|---|
| v2.0.0 ↗ | nuget | 2026-09-22 | Published EricksonLopez.Mapper 2.0.0 to NuGet.org. |
| v2.0.0 ↗ | github | 2026-09-22 | Ecosystem Packages in this release | Package | Version | |---------|---------| | `EricksonLopez.Mapper.Abstractions` | `2.0.0` | | `EricksonLopez.Mapper` | `2.0.0` | | `EricksonLopez.Mapper.Generator` | `2.0.0` | | `EricksonLopez.Mapper.Analyzers` | `2.0.0` | | `EricksonLopez.Mapper.DomainPrimitives` | `2.0.0` | | `EricksonLopez.Mapper.Mapster` | `2.0.0` | | `EricksonLopez.Mapper.Result` | `2.0... |
| v1.0.0 ↗ | github | 2026-08-27 | Ecosystem Packages in this release | Package | Version | |---------|---------| | `EricksonLopez.Mapper.Abstractions` | `1.0.0` | | `EricksonLopez.Mapper` | `1.0.0` | | `EricksonLopez.Mapper.Generator` | `1.0.0` | | `EricksonLopez.Mapper.Analyzers` | `1.0.0` | | `EricksonLopez.Mapper.DomainPrimitives` | `1.0.0` | | `EricksonLopez.Mapper.Mapster` | `1.0.0` | | `EricksonLopez.Mapper.Result` | `1.0... |
| v1.0.0 ↗ | nuget | 2026-08-27 | Published EricksonLopez.Mapper 1.0.0 to NuGet.org. |
16. Complementary & Related Libraries#
Libraries in the same tier, architectural layer, or directly paired via dependency edges.
17. Documentation, API Reference & Portal Links#
Conceptual Documentation (Starlight) →
Extracted XML API Reference →
7 namespaces · 46 types · 126 members
Ecosystem Dependency Map →
Learning Center & Handbook →
Per-library conceptual Starlight pages expand in M4; API Reference pages expand in M3.2.
18. Source Repository, License & Contributing#
Released under the MIT License. All assemblies follow EricksonLopez.* build invariants: explicit imports, strong-name signing (`EricksonLopez.snk`), and ASCII author metadata (`Erickson Lopez`).
19. Troubleshooting, Pitfalls & Migration Guidance#
- EricksonLopez.Mapper.Mapster is an optional compatibility bridge marked IsAotCompatible=false; use core Mapper for Full AOT builds.
- Version lag detected: NuGet.org latest published version is v2.0.0, while local repository HEAD is at v3.0.0.
20. Quality & Verification Evidence#
- Strong-Name Signing (`EricksonLopez.snk`)
- EricksonLopez.snk
- `ImplicitUsings=disable`
- disable
- XML Documentation Extraction
- Verified (7 namespaces, 46 types, 126 members)
- MSBuild AOT / Trim Attributes
- 4 Full / 0 Partial / 1 Incompatible / 2 N/A
- BenchmarkDotNet Artifacts
- 22 total (22 measured, 0 na_error)
Explicit Verification Boundaries & Limitations
- All verified measurements below come strictly from `BenchmarkDotNet.Artifacts` running on .NET RyuJIT (0 NativeAOT benchmark runs exist in this snapshot).