EricksonLopez.Mapper

dotnet-mapper · Mapping & Serialization

On this page (20 sections)

1. Identity, Tier & Maturity Profile#

L2 Cross-Cutting & ReliabilityStableMaintenance: ActiveAOT: PartialMIT LicenseConfidence: HIGH
ApplicationCross-Cuttingnet8.0net9.0net10.0netstandard2.0

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
Also published in this family:
EricksonLopez.Mapper.AbstractionsEricksonLopez.Mapper.DomainPrimitivesEricksonLopez.Mapper.MapsterEricksonLopez.Mapper.ResultEricksonLopez.Mapper.GeneratorEricksonLopez.Mapper.Analyzers

4. Verified Ecosystem Metrics#

v2.0.0
NuGet Published Version
v3.0.0
Repo HEAD Version
2,330
NuGet Downloads
7
Packable Packages
126
Public API Members
22
Benchmark Rows (RyuJIT)

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 IDStatusNuGet / LocalTFMsAOT StatusDownloadsDescription
EricksonLopez.MapperPrimaryPublishedv2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Full466Package Description
EricksonLopez.Mapper.AbstractionsPublishedv2.0.0 / v3.0.0netstandard2.0, net8.0, net9.0, net10.0AOT: Full458Package Description
EricksonLopez.Mapper.DomainPrimitivesPublishedv2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Full271DomainPrimitives integration for EricksonLopez.Mapper. Enables mapping strongly-typed IDs and value objects to and from primitive types.
EricksonLopez.Mapper.MapsterPublishedv2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Incompatible270Mapster integration adapter for EricksonLopez.Mapper. Bridges Mapster's configuration and runtime adapter engine with the unified EricksonLopez.Mapper abstraction contracts.
EricksonLopez.Mapper.ResultPublishedv2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Full263Result monad mapping extensions for EricksonLopez.Mapper. Enables functional projection of Result<T> and collections.
EricksonLopez.Mapper.GeneratorAnalyzer / GeneratorPublishedv2.0.0 / v3.0.0netstandard2.0AOT: N/A (Analyzer/Legacy)334Package Description
EricksonLopez.Mapper.AnalyzersAnalyzer / GeneratorPublishedv2.0.0 / v3.0.0netstandard2.0AOT: N/A (Analyzer/Legacy)268Package 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#

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
EricksonLopez.Mapper Dependency Topology2 upstream library dependencies and 0 downstream dependent libraries verified in dependencies.json.
View accessible text summary and structure

2 upstream library dependencies and 0 downstream dependent libraries verified in dependencies.json.

DirectionLibraryTierRelationship Kinds
UpstreamEricksonLopez.DomainPrimitivesL0Compile-Time, NuGet Package
UpstreamEricksonLopez.ResultL0Adapter, 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_result

10. Target Frameworks & Native AOT / Trimming Matrix#

MSBuild `.csproj` inspection across 7 packages: 4 Full, 0 Partial, 1 Incompatible, 2 NotApplicable (analyzers/generators).

Package IDIsAotCompatibleEnableTrimAnalyzerVerified AOT StatusTarget Frameworks
EricksonLopez.MappertruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Mapper.AbstractionstruetrueFullnetstandard2.0, net8.0, net9.0, net10.0
EricksonLopez.Mapper.DomainPrimitivestruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Mapper.MapsterfalsetrueIncompatiblenet8.0, net9.0, net10.0
EricksonLopez.Mapper.ResulttruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Mapper.GeneratorfalsenullNotApplicablenetstandard2.0
EricksonLopez.Mapper.AnalyzersfalsenullNotApplicablenetstandard2.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

Verified External NuGet Dependencies (6)

MapsterMicrosoft.CodeAnalysis.AnalyzersMicrosoft.CodeAnalysis.CommonMicrosoft.CodeAnalysis.CSharpMicrosoft.CodeAnalysis.CSharp.WorkspacesSystem.Composition.AttributedModel

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).

Total rows: 22 · Measured: 22 · NA / Error: 0 · Suites: 3

Observed runtimes: .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI

Observed CPUs: Unknown processor

SuiteMethodRuntimeMean (ns)Allocated (B)Status
MappingBenchmarksGenerator_Poco.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI2.79832measured
MappingBenchmarksMapperly_Poco.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI2.79932measured
MappingBenchmarksManual_Poco.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI2.90932measured
ValueObjectBenchmarksManual_ValueObjects.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI3.02556measured
ValueObjectBenchmarksMapperly_ValueObjects.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI3.14956measured
ValueObjectBenchmarksGenerator_ValueObjects.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI3.20656measured
MappingBenchmarksMapster_Poco.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI8.44232measured
ValueObjectBenchmarksMapster_ValueObjects.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI8.87456measured
MappingBenchmarksMapperlyMapping.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI16.06192measured
MappingBenchmarksGeneratorMapping.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI16.13192measured
MappingBenchmarksMapperly_Complex.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI17.239200measured
MappingBenchmarksGenerator_Complex.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI17.363200measured
PolymorphicBenchmarksManual_Polymorphic.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI21.35184measured
PolymorphicBenchmarksGenerator_Polymorphic.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI22184measured
MappingBenchmarksAutoMapper_Poco.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI24.90432measured
PolymorphicBenchmarksMapperly_Polymorphic.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI27.57184measured
MappingBenchmarksMapsterMapping.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI1,274.198,248measured
MappingBenchmarksMapster_Complex.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI1,282.3458,256measured
MappingBenchmarksManualMapping.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI1,454.298,248measured
MappingBenchmarksManual_Complex.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI1,482.348,256measured
MappingBenchmarksAutoMapperMapping.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI3,510.0716,792measured
MappingBenchmarksAutoMapper_Complex.NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI3,569.34416,800measured

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.

VersionSourcePublished DateSummary
v2.0.0 ↗nuget2026-09-22Published EricksonLopez.Mapper 2.0.0 to NuGet.org.
v2.0.0 ↗github2026-09-22Ecosystem 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 ↗github2026-08-27Ecosystem 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 ↗nuget2026-08-27Published EricksonLopez.Mapper 1.0.0 to NuGet.org.

Libraries in the same tier, architectural layer, or directly paired via dependency edges.

17. Documentation, API Reference & Portal Links#

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).

Search EricksonLopez.* Ecosystem

Type a library name, NuGet package ID, .NET type, or architectural concept to search across the portal.