Mappa v10.0.0
From the portfolio: Mappa
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.
-
MappaAssignToContextattribute (#205, #207) — Assign mapped values intoMappaContextduring generation. -
MappaSettingsproperty 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) — Mapstringto any type that exposesstatic TTarget Parse(string). -
Numeric format and
IFormatProvider(#76, #216) — Control culture and format for numericParse/ToStringconversions.
[MappaInvokeMethod] attribute
-
MappaContextparameters (#70, #206) — Invoked methods can acceptMappaContextarguments. - 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.
-
MappaDependencyin base classes (#183, #197) — Fields and properties marked withMappaDependencyare 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.
-
MappaInvokeMethoddocs forMappaContext(#209, #212) — Documented rules forMappaContextin invoked methods. -
AOT samples coverage (#41, #198) —
Mappa.Samples.Aotnow 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
NumberStylesforParseon all numeric types -
#214 — Support
DateTimeStyleforParse/ParseExactonDateTime,DateOnly,TimeOnly - #184 — More relaxed nullability when matching methods
-
#181 — Speed up enum mappings with
switchexpressions - #175 — Support mapping empty → empty type
-
#155 — Add
MappaUseConstructorattribute to pick which constructor to use - #120 — Allow mapping via nested source property chains
- #73 — Support fields, not only properties
-
#67 —
MappaInvokeMethodAttribute: addSourcePropertyparameter - #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
oneoffor both source and target