๐บ๏ธ Mappa v10.0.0
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 issue that I would like to cover in the upocoming 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