Replies: 1 comment
-
We have value converters and value transformers that don't need the source and destination objects. But if you don't call |
Beta Was this translation helpful? Give feedback.
0 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.
-
I've got a bit of a weird use case; there's a lot of reflection going on in my application, and I assure you you don't want to know the details. :)
The gist: At runtime, I would like to be able to execute a single configured PropertyMap transformation at a time, having an object to input of the same type as SourceMember, but without having an instance of the full source object the TypeMap is defined against. I'd thought that PropertyMap might have a method to provide this transformation, but I ultimately couldn't find anything to do a mapping with anything short of full TypeMap pairs. This is entirely reasonable, just not what I might have hoped. :)
In all of my configurations, only the value of the source member goes into generating the mapped destination member's value. I do make liberal use of IMemberValueResolver, but in all implementations only the sourceMember property is used, not the actual source or destination objects. It's clear that a lone PropertyMap could fail to resolve with something as simple as having a straight IValueResolver attached, though, which again makes all of this very reasonable.
I can work around this issue by instantiating 'mock' copies of the source and destination objects, populating only the source member that I need, and running the map. This just has a lot of overhead, and I wanted to make absolutely sure I'm not being dumb and missing something obvious somewhere in the API that can service my use case. If so, please share! If not, probably for the best. :) Either way, love the framework, and thank you for your ongoing work on it!
Beta Was this translation helpful? Give feedback.
All reactions