Record ForCtorParam MapFrom validation #4143
killergege
started this conversation in
NA
Replies: 1 comment 3 replies
-
The message is about the property |
Beta Was this translation helpful? Give feedback.
3 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.
Uh oh!
There was an error while loading. Please reload this page.
-
Source/destination types
Mapping configuration
Version: 12.0.0
Expected behavior
Mapping works and
config.AssertConfigurationIsValid();
does not throwActual behavior
Mapping works but
config.AssertConfigurationIsValid();
throws.When fields have the same name but different type, it seems that the validator doesn't detect that the field mapping is overriden and tries to map the source type with the target type.
There is no issue when the
Target
object is a class, and the mapping is done withForMember
instead ofForCtorParam
.Steps to reproduce
Fiddle demo : https://dotnetfiddle.net/WoqHS4
Beta Was this translation helpful? Give feedback.
All reactions