Could Mapster notify about an unmapped property of the source object? #739
Unanswered
plenartowicz
asked this question in
Q&A
Replies: 2 comments 2 replies
|
Are you asking if there is a way to configure Mapster so that Name is mapped to Description, or are you asking if there is some way to be notified that the mapping (without any configuration) is creating a null value? Do you think that a runtime exception is really the best way to handle this rather than having unit tests that would catch this? |
1 reply
|
The issue would seem to be that you have various types and you want to map from type A to type B, and from type C to type D and you want to make sure that the types you want to map to have the same properties as the type you are mapping from. So this doesn't even need to involve Mapster. With xUnit you could do the following: |
1 reply
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.
I love Mapster because of I don't have to write any configuration. It just works. In most cases, this is an advantage.
But when renaming properties this sometimes becomes a drawback.
For instance:
When I rename
Nameproperty of classSource, after adaptingd.Namewill benull.There is no configuration so Mapster couldn't adapt
Descriptionto `Name. But I would like to know about this.So the question is: Is there any way to Mapster notifies about this or provides configuration for this behavior?
I couldn't find any setting which helps me.
All reactions