Skip to content

Search EricksonLopez.* Ecosystem

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

Core Concepts — Attributes, Converters & Polymorphic Mapping

EricksonLopez.Mapper drives deterministic C# emission strictly from declarative attributes on partial mapper types.

  • [Mapper(StrictMapping = true)]: Enables source generation; StrictMapping defaults to true.
  • [MapProperty(sourceName, destinationName)]: Maps renamed properties explicitly.
  • [MapIgnore(destinationName)] / [MapIgnoreSource(sourceName)] / [MapperIgnore]: Excludes unmapped targets or sources cleanly without tripping ELM001.
  • [MapValue(destinationName, valueExpression)] & [MapNullFallback(destinationName, fallbackExpression)]: Supplies constant defaults or null fallbacks.
  • [EnumMappingStrategy(...)] & [MapEnumValue(source, target)]: Controls enum mapping strategy and explicit case remapping.
  • [MapFactory(methodName)]: Delegates object construction to a custom factory method (ELM017 if unresolved).
  • [MapDerivedType(sourceType, targetType)]: Emits polymorphic type-switch dispatch (ELM010 detects cycles across derived types in v2.0.0).
  • [UseConverter(type | fieldName)]: Applies custom IConverter<TSource, TDestination> converters.

In v2.0.0, nullable destination collections initialize to null when source is null instead of silently allocating empty collections, and DateOnly → DateTimeOffset conversions force DateTimeKind.Utc.