feat: support [MappingTargetOriginalValue] parameter in user-defined mapping methods#2306
Merged
Merged
Conversation
juliancarrivick
commented
Jun 6, 2026
latonz
requested changes
Jun 22, 2026
latonz
left a comment
Contributor
There was a problem hiding this comment.
Thank you for this contribution! I added my feedback.
Contributor
|
The vulnerability scanning which fails the test GH Action job should be gone once you rebase onto main. |
Contributor
Author
|
Thanks for the review @latonz ! I'm currently on holiday but will address your comments after I'm back next week :) |
Contributor
|
enjoy your time off! |
juliancarrivick
force-pushed
the
user-mapping-target-value
branch
from
July 4, 2026 09:48
e5a4ba3 to
4e98d97
Compare
juliancarrivick
commented
Jul 4, 2026
juliancarrivick
left a comment
Contributor
Author
There was a problem hiding this comment.
Alright, I think I've covered everything - let me know if you require any further changes (and build should pass this time).
Thanks!
latonz
requested changes
Jul 6, 2026
latonz
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the updates, I added my feedback.
…mapping methods Adds MappingTargetOriginalValueAttribute, which marks a parameter in a user-implemented mapping method to receive the existing target member value. Useful for merge-style mappings that need to combine source and destination data rather than fully overwrite. Support for [MappingTarget] is not included as the common use-case there is to take the entire target object and this will end up being the exact same reference as the "original value". Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
juliancarrivick
force-pushed
the
user-mapping-target-value
branch
from
July 11, 2026 11:38
4e98d97 to
40b6a78
Compare
latonz
approved these changes
Jul 13, 2026
Contributor
|
Thank you for this contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support [MappingTargetOriginalValue] parameter in user-defined mapping methods
Description
Following feedback in #2242, fixing #276 instead to cover the
Optionaluse-case.Here we add
MappingTargetOriginalValueAttribute, which marks a parameter in a user-implemented mapping method to receive the existing target member value. Useful for merge-style mappings that need to combine source and destination data rather than fully overwrite.Support for
[MappingTarget]is not included as the use-case there is to work with entire object references instead of members. In that case both the "target" and the "original" value will end up being the same reference lead to potential confusion.Thank you for considering this PR.
Checklist
MemberAssignmentMapping.TargetValueGetterinMemberMappingBuilder)