A new version of Mappa (v10.0.0) has been released.

Mappa 10.0.0 is a major release. It targets .NET 10, adds polymorphic mapping and richer configuration, and expands MappaInvokeMethod, constructor mapping, and collection support. Documentation and samples were reviewed end-to-end. Full changelog: v1.2.0…v10.0.0

What’s new

Platform

  • Migrate to .NET 10 (#178, #188) — Mappa now targets .NET 10; upgrade consuming projects accordingly.

New features

  • Polymorphic mapping (#49, #187) — Map base types to derived instances when the runtime type is known.
  • MappaAssignToContext attribute (#205, #207) — Assign mapped values into MappaContext during generation.
  • MappaSettings property name matching (#98, #211) — Configure how source and target property names are matched (e.g. case sensitivity).
  • Constructor strategy: ignore target properties (#3, #204) — Exclude specific target properties from constructor-based mapping via attribute.
  • String → Parse(string) mapping (#52, #177) — Map string to any type that exposes static TTarget Parse(string).
  • Numeric format and IFormatProvider (#76, #216) — Control culture and format for numeric Parse / ToString conversions.

[MappaInvokeMethod] attribute

  • MappaContext parameters (#70, #206) — Invoked methods can accept MappaContext arguments.
  • Hierarchy lookup (#179, #199) — Optional fields, properties, and methods are resolved up the class hierarchy.
  • Instance member access (#193, #195) — Non-static fields and properties are referenced with this. in generated code.
  • Static vs. instance safety (#190, #194) — A static mapping method cannot invoke a non-static method.
  • Non-static method dependencies (#185, #191) — Method dependency lookup can use accessible non-static methods where appropriate.

Mapping improvements

  • Collection concrete types with capacity constructors (#109, #176) — Support collection types that expose a capacity constructor.
  • Read-only collection properties (#110, #202) — Broader support when targeting read-only properties of collection types.
  • Inherited mapping methods (#186, #196) — Methods used for mapping are discovered in parent classes.
  • MappaDependency in base classes (#183, #197) — Fields and properties marked with MappaDependency are picked up from accessible members in parent classes.

Diagnostics and quality

  • Missing attribute warnings (#154, #203) — Additional compiler warnings for misconfigured or incomplete attribute usage.
  • EditorConfig integration tests for MappaSettings (#210, #213) — Settings behavior is validated against EditorConfig configuration.

Documentation and samples

  • Tutorial and documentation review (#148, #217) — Tutorial advanced topics, attribute reference, error codes, and package READMEs updated and aligned with current behavior.
  • MappaInvokeMethod docs for MappaContext (#209, #212) — Documented rules for MappaContext in invoked methods.
  • AOT samples coverage (#41, #198) — Mappa.Samples.Aot now runs all sample mappers for native/AOT validation.

Maintenance

  • CI and tooling (#200, #201) — GitHub Actions dependencies bumped to current versions.
  • TODO hygiene (#182, #189) — Guard against leftover issue TODOs in the codebase.

What’s next

This is a tentative and non-exhaustive list of issues that I would like to cover in the upcoming version of Mappa:

Mapping / generator features

  • #215 — Support NumberStyles for Parse on all numeric types
  • #214 — Support DateTimeStyle for Parse / ParseExact on DateTime, DateOnly, TimeOnly
  • #184 — More relaxed nullability when matching methods
  • #181 — Speed up enum mappings with switch expressions
  • #175 — Support mapping empty → empty type
  • #155 — Add MappaUseConstructor attribute to pick which constructor to use
  • #120 — Allow mapping via nested source property chains
  • #73 — Support fields, not only properties
  • #67MappaInvokeMethodAttribute: add SourceProperty parameter
  • #29 — Option to prefer arrays over lists in generated code
  • #19 — Fail enum→enum maps when not all source values are mappable

Language / platform

  • #174 — Support C# 14 extension blocks in static classes (partial classes assumed)

Protobuf

  • #89 — Polymorphism via protobuf oneof for both source and target

Testing / benchmarks / CI

  • #208 — Migrate away from FluentAssertions
  • #119 — Migrate to xUnit v3
  • #134 — Improve benchmarks
  • #152 — Run benchmarks on CI/CD when merging to main