Skip to content

Remove static mapper and add DSL - #5

Merged
BenjaminVettori merged 4 commits into
mainfrom
feature/remove-static-mapper
Mar 24, 2026
Merged

Remove static mapper and add DSL#5
BenjaminVettori merged 4 commits into
mainfrom
feature/remove-static-mapper

Conversation

@BenjaminVettori

Copy link
Copy Markdown
Owner
  • Removed static mapper since it got outdated and did not support markers the same way as with mapping profiles.
    This is a breaking change, thus the major version in increased.
    It is relatively easy to replace the static mapper though, by creating a static instance of Mapify.
  • Added a DSL in addition to the initializer syntax, to allow smaller mapping definitions if the required keyword is used often on target types.

Benjamin Vettori added 4 commits March 23, 2026 21:48
* Removes the static Mapper class since it does not cover all features (parameters, ignore, usemap) and setting up Profiles with a single instance has the same effect as using the static mapper.
* Moved parts of the static mapper, which are still used, to the Mapify class.
* Removed unittests for the static mapper.
* Updated the readme
+semver:major
Added a .Map fluent API to be able to register single property mappings.
This allows to avoid the initializer mapping e.g. if the required keyword is used often in target types, where each required property would have to be mapped explicitely, even if they could be mapped by convention.
The initializer mapping works as before though, since the DSL is just an addition.
Added more tests to ensure that objects with required fields are mapped correctly.
Fixed an issue where ignored bindings were removed for DSL bindings that used the Ignored marker.
Removes the requirement to install the .NET Framework developer pack on CI runners by adding `Microsoft.NETFramework.ReferenceAssemblies` to the project files. Also updates the test runner label in the CI workflow to net472.
@BenjaminVettori
BenjaminVettori merged commit 7e1d17d into main Mar 24, 2026
1 check passed
@BenjaminVettori
BenjaminVettori deleted the feature/remove-static-mapper branch March 24, 2026 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant