Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
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 have a very simple class, wrapping a double and providing me a custom ToString():
With Automapper (version 10.1.1) I try to map a
double?
to thisAge
class, but whatever I try, it won't work. See below my tests.My first try was the 'plain' way:
I do understand that this does not work, because when I check the execution plan, it clearly shows the null check done by AutoMapper.
So, my next try was a custom TypeConverter:
This solution does not work either. Checking the execution plan tells me that the
Convert
method of theCustomAgeResolver
should be called, but that does not happen.Am I doing something wrong here? Or is there an easier way to implement the AutoMapping?
Any advice is welcome!
Beta Was this translation helpful? Give feedback.
All reactions