-
-
Notifications
You must be signed in to change notification settings - Fork 196
Include mapping configuration #1833
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
Include mapping configuration #1833
Conversation
test/Riok.Mapperly.Tests/Mapping/IncludeMappingConfigurationTest.cs
Outdated
Show resolved
Hide resolved
Thank you for this contribution — at first glance, it looks pretty good! 😊 |
No problem, it is still a long way to go. 🙂 |
test/Riok.Mapperly.Tests/Mapping/IncludeMappingConfigurationTest.cs
Outdated
Show resolved
Hide resolved
Added the |
335fae0
to
32a8e5b
Compare
I saw that nested mappings processed separatelly. First I just tried to use recursive mapping there too. This lead to duplicate error reportings. |
1c09496
to
2408297
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.
I leave some remarks about my changes, so we can discuss them.
src/Riok.Mapperly/Descriptors/MappingBodyBuilders/BuilderContext/IgnoredMembersBuilder.cs
Outdated
Show resolved
Hide resolved
src/Riok.Mapperly/Descriptors/MappingBodyBuilders/BuilderContext/MembersMappingStateBuilder.cs
Show resolved
Hide resolved
I made a few improvements on the tests. |
I'll have a look this week or the beginning of the next week. Thank you for your efforts! |
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.
Thank you for all your work and your patience!
src/Riok.Mapperly/Descriptors/MappingBodyBuilders/BuilderContext/IgnoredMembersBuilder.cs
Outdated
Show resolved
Hide resolved
I think I managed to fix the test failures, but if there are still some, I'll take care of them another day with the rest of feedbacks. |
Also, I realized, the .NET 6.0 integration tests don't run. |
Hopefully, I managed to fix all the build errors, except one: |
Include mapping configuration
Work in progress Info
Hi @latonz,
I decided to try implementing this feature because I feel this is an important feature, and we could also use it.
Since the basics of this started working as expected, and I found the integration points that feel correct, I think I can create a complete implementation.
Currently, it is still work in progress, but this way you are aware that I'm working on it and you can guide me.
Implementation Details
MembersMappingConfiguration
is extended with anIncludedMapping
property that holds the target mapping's name.MembersMappingConfiguration
is extended with aName
property that holds the current mapping's name.MappingCollection
now also holds theMappingBuilderContext
in a ListDictionary. This is used to get context by name.IncludeMappingBuilder
which recursively walks through the mappings and connects the configurations.ReferencedMappingNotFound
. (Not sure if it is correct, or a new one is needed.)NamedMapping
. Currently, it is simply an alias, and it doesn't have preference over the unnamed mappings.Fixes #513
Checklist