Can I increase the verbosity of mapping errors? #72
Replies: 4 comments 3 replies
-
@leonardoporro please could you advise? I tried pulling your source code down in the hope I could step into the code as it maps, but I experience the exact same result I used the following mapping config your documentation suggests:
|
Beta Was this translation helpful? Give feedback.
-
Hi @heyadamhey, |
Beta Was this translation helpful? Give feedback.
-
Property mapping is dynamic code and probably the most difficult part of the library, |
Beta Was this translation helpful? Give feedback.
-
do we need to add anything else here? |
Beta Was this translation helpful? Give feedback.
-
When I'm mapping an object graph, I get the following exception
Stack Trace:
for context, in
_context.Map<Domain.Casino>(casino)
casino
is aDomain.Casino
, so the type is the same and therefore all properties will be a 1:1 match.The Exception Details window doesn't provide any insight into what is causing the mapping to fail.
I experienced this on a simpler object because a nullable DateTime property was null. When I ensured the property had a value, the mapping succeeded. When I try mapping an object with a lot of properties, collections etc I get the exception, but it would be great to find a simple way to debug the breakdown in the mapping. Maybe it's trying to map a nullable to a non-nullable property, which is easy enough to fix but knowing which property to address would be a huge help
Thanks
Adam
Beta Was this translation helpful? Give feedback.
All reactions