EricksonLopez.Mapper
dotnet-mapper · Mapeo y Serialización
En esta página (20 secciones)
1. Identidad, Nivel y Perfil de Madurez#
2. Propuesta de Valor y Problema que Resuelve#
High-performance, compile-time, reflection-free, Native AOT object mapping ecosystem for modern .NET, powered by Roslyn Incremental Source Generators.
Los mapeadores basados en reflexión introducen sobrecarga JIT, generan advertencias IL2026/IL3050 en Native AOT y evaden constructores o fábricas DDD.
3. Instalación Rápida#
Paquete principal: 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. Métricas Verificadas del Ecosistema#
Instantánea recuperada UTC: 2026-12-01
5. Cuándo Usar y Cuándo NO Usar#
Cuándo usar
- Quieres mapeos generados en compilación verificados por analizadores Roslyn (ELM001–ELM018) con soporte para StrongId y Result<T>.
Cuándo NO usar
- Dependes de reglas dinámicas configuradas en tiempo de ejecución imposibles de expresar con tipos conocidos en compilación.
6. Capacidades Principales e Invariantes de Diseño#
Generación Sin Reflexión
Emite métodos de mapeo legibles en compilación sin System.Reflection ni Activator en rutas principales.
Adaptadores DDD y Result
Soporta [MapFactory], [MapIgnore], [MapDerivedType], conversión de ValueObjects y ResultMappingExtensions.
7. Paquetes NuGet y Adaptadores Incluidos#
| ID del Paquete | Estado | NuGet / Local | TFMs | Estado AOT | Descargas | Descripción |
|---|---|---|---|---|---|---|
| EricksonLopez.MapperPrincipal | Publicado | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Completo | 466 | Package Description |
| EricksonLopez.Mapper.Abstractions | Publicado | v2.0.0 / v3.0.0 | netstandard2.0, net8.0, net9.0, net10.0 | AOT: Completo | 458 | Package Description |
| EricksonLopez.Mapper.DomainPrimitives | Publicado | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Completo | 271 | DomainPrimitives integration for EricksonLopez.Mapper. Enables mapping strongly-typed IDs and value objects to and from primitive types. |
| EricksonLopez.Mapper.Mapster | Publicado | 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 | Publicado | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Completo | 263 | Result monad mapping extensions for EricksonLopez.Mapper. Enables functional projection of Result<T> and collections. |
| EricksonLopez.Mapper.GeneratorAnalizador / Generador | Publicado | v2.0.0 / v3.0.0 | netstandard2.0 | AOT: N/A (Analizador/Legado) | 334 | Package Description |
| EricksonLopez.Mapper.AnalyzersAnalizador / Generador | Publicado | v2.0.0 / v3.0.0 | netstandard2.0 | AOT: N/A (Analizador/Legado) | 268 | Package Description |
8. Ejemplo Quick Start#
Basado en APIs públicas verificadas de EricksonLopez.Mapper. Compila con `<ImplicitUsings>disable</ImplicitUsings>` e importaciones explícitas.
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. Arquitectura y Flujo de Dependencias#
Renderizando diagrama…
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
Ver descripción textual y tabla accesible
2 dependencias hacia librerías aguas arriba y 0 librerías dependientes aguas abajo verificadas en dependencies.json.
| Dirección | Librería | Nivel | Tipos de Relación |
|---|---|---|---|
| Aguas arriba | EricksonLopez.DomainPrimitives | L0 | Tiempo de compilación, Paquete NuGet |
| Aguas arriba | EricksonLopez.Result | L0 | Adaptador, Paquete NuGet |
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 y Matriz Native AOT / Trimming#
Inspección MSBuild `.csproj` sobre 7 paquetes: 4 Full, 0 Partial, 1 Incompatible, 2 NotApplicable (analizadores/generadores).
| ID del Paquete | IsAotCompatible | EnableTrimAnalyzer | Estado AOT Verificado | 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. Dependencias Aguas Arriba y Dependientes Aguas Abajo#
Dependencias Aguas Arriba (2)
Dependientes Aguas Abajo (0)
Ninguna otra librería EricksonLopez.* depende actualmente de esta familia.
12. Adaptadores Opcionales e Integraciones Externas#
Aristas de Adaptadores Internos y Paquetes de Integración
- EricksonLopez.Mapper.Result→ EricksonLopez.Result (EricksonLopez.Result)
Dependencias NuGet Externas Verificadas (6)
13. Resumen de Configuración y Registro en DI#
Puntos de Entrada DI y Configuración Verificados
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`.
Tipos Públicos y Contratos Clave
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. Benchmarks de Rendimiento Verificados#
Todas las mediciones verificadas provienen estrictamente de `BenchmarkDotNet.Artifacts` ejecutados sobre .NET RyuJIT (existen 0 ejecuciones NativeAOT en esta instantánea).
| Suite | Método | Runtime | Media (ns) | Asignado (B) | Estado |
|---|---|---|---|---|---|
| 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. Historial de Versiones y Estado NuGet vs Repositorio#
Desfase de versiones detectado: la última versión publicada en NuGet.org es v2.0.0, mientras el HEAD del repositorio local está en v3.0.0.
| Versión | Origen | Fecha de Publicación | Resumen |
|---|---|---|---|
| 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. Librerías Complementarias y Relacionadas#
Librerías en el mismo nivel, capa arquitectónica o vinculadas directamente mediante aristas de dependencia.
17. Documentación, API Reference y Enlaces del Portal#
Documentación Conceptual (Starlight) →
Referencia de API XML Extraída →
7 namespaces · 46 tipos · 126 miembros
Mapa de Dependencias del Ecosistema →
Centro de Aprendizaje y Manual →
Las páginas conceptuales por librería en Starlight se completan en M4; las páginas de API Reference en M3.2.
18. Repositorio Fuente, Licencia y Contribución#
Publicado bajo Licencia MIT. Todos los ensamblados cumplen los invariantes de compilación EricksonLopez.*: importaciones explícitas, firma fuerte (`EricksonLopez.snk`) y metadatos de autor en ASCII (`Erickson Lopez`).
19. Resolución de Problemas, Riesgos y Migración#
- EricksonLopez.Mapper.Mapster es un puente opcional marcado IsAotCompatible=false; usa el núcleo Mapper para compilaciones Full AOT.
- Desfase de versiones detectado: la última versión publicada en NuGet.org es v2.0.0, mientras el HEAD del repositorio local está en v3.0.0.
20. Evidencia de Calidad y Verificación#
- Firma Fuerte (`EricksonLopez.snk`)
- EricksonLopez.snk
- `ImplicitUsings=disable`
- disable
- Extracción de Documentación XML
- Verificado (7 namespaces, 46 tipos, 126 miembros)
- Atributos MSBuild AOT / Trimming
- 4 Full / 0 Partial / 1 Incompatible / 2 N/A
- Artefactos BenchmarkDotNet
- 22 total (22 measured, 0 na_error)
Límites Explícitos de Verificación y Alcance
- Todas las mediciones verificadas provienen estrictamente de `BenchmarkDotNet.Artifacts` ejecutados sobre .NET RyuJIT (existen 0 ejecuciones NativeAOT en esta instantánea).