-
-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Map from source object #1247
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contribution! I really like the idea of MemberPath.ToDisplayString
.
And great test coverage 👍
I added my feedback 😊
...Riok.Mapperly/Descriptors/MappingBodyBuilders/BuilderContext/MembersMappingBuilderContext.cs
Outdated
Show resolved
Hide resolved
src/Riok.Mapperly/Descriptors/Mappings/MemberMappings/MemberExistingTargetMapping.cs
Outdated
Show resolved
Hide resolved
a041f5f
to
f62b46b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates 😊 Only open feedback point: #1247 (comment).
Thank you for this great addition to Mapperly! |
🎉 This PR is included in version 3.6.0-next.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 3.6.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Allow mapping from source object
Description
Adds a
MapPropertyFromSourceAttribute
, that allows using the source object directly for mappings. In most of the code, this is represented as an empty sourceMemberPath
. This required a few changes, as most of the code just assumedMemberPath
s were not empty. Currently, when aMapPropertyFromSourceAttribute
is used, all unused source member diagnostics are suppressed, as there is no way to analyse for every situation what members of the source are used by the conversion. This can be changed to require explicit ignore attributes for all members that are used implicitly by the mapping from source.An additional reason for wanting this, apart from the arguments discussed in #1161, is to allow these kind of mappings for required or init-only members.
Fixes #1161
Checklist