Replies: 1 comment 6 replies
-
This use case is currently not supported by Mapperly. However, couldn't you move the method in another class (not annotated with |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, i have implemented mapperly with UseReferenceHandling = true but some of my methods have custom implementations and are used directly to map my objects, therefore im kinda unsure what i should do, since i wanted mapperly to create a PreserveReferenceHandler instance.
Example:
Car has wheels and wheel has a car
In this case, my wheels map method is called directly, should i be extending IReferenceHandler and implement my own class like PreserveReferenceHandler? I guess i expected mapperly to do that load for me. Also, tried removing the attribute from the argument but i get stackoverflow, i assume it's because that custom implementation is not taking care of circular dependencies.
Can someone point me in the right direction please?
Thanks in advance :)
EDIT: added a few more information and also some clarifications
EDIT 2: Also, when i added [Mapper(UseReferenceHandling = true)] to my class (which is a lot more complex than the example i provided), i started having errors regarding some specific properties not being mapped properly (when they are already ignored) and whenever i placed certain maps in different lines of the file, sometimes it fixed the "errors", sometimes it just caused more. Is this normal or is it a bug?
Beta Was this translation helpful? Give feedback.
All reactions