Replies: 3 comments 3 replies
-
I just found out the workaround doesn't actually work, since the compiler ignores my |
Beta Was this translation helpful? Give feedback.
-
So I would be willing to contribute to add this feature. I made some POC code in mapperly that supports this, but is nowhere near production ready. But I would like to have some indication on of you are willing to allow such an addition to the library or not, before putting more effort into this and showing the poc implementation to get a sense of the chosen solution it what you want it to be. And you don't want to have this kind of functionality in the library, I would like to know what the alternatives are to this, because without this, we are not able to use mapperly in our project. Why not? You might ask: |
Beta Was this translation helpful? Give feedback.
-
This is available as a preview release |
Beta Was this translation helpful? Give feedback.
-
We are migrating from Automapper to mapperly. And we want to get errors about missing source or target member mappings, to makes sure that all members that need to be mapped are mapped. So we enabled the severity:
this works, and we can real time errors if something is wrong. However, most of the time we want either all source or all target properties to be mapped (in automapper we could determine this by using the
MemberList.Source
orMemberList.Target
). If we would have an attribute we could set to simply set the ignore ALL unmapped source/target properties, we wouldn't have to add a millionMapperIgnoreTarget
orMapperIgnoreSource
attributes to mapping functions. Something like:Edit:
I came up with a workaround that is not ideal but it works, so I'm using it for now. We still have set the severity to error for the unmapped source and target members, but we have created 2 mappers, and use the
SuppressMessage
attribute on them to suppress either the unmapped source or unmapped target members:Beta Was this translation helpful? Give feedback.
All reactions