Demonstrate a record mapping issue#924
Demonstrate a record mapping issue#924mindysport wants to merge 2 commits intoMapsterMapper:developmentfrom
Conversation
…nfigurations allow backing fields to sneak in.
…in isolation from each other and on their own) solve the immediate problem and cause the tests to pass, but I'm not sure which fix (if any) fits best with the codebase, but I wanted to attempt to provide a suggestion at least.
|
Hi @mindysport. Perhaps you have a UseDestinationValue setting in your global configuration with some criteria. Or do the fields themselves have this attribute? Update: This does not appear in all examples. |
|
@DocSvartz You're right that it doesn't appear in all the example tests I created, and I should have been clearer with them (perhaps I should have removed all of them except the ones that fail, but I thought the extra tests helped narrow the scope of the issue I'm seeing). The tests demonstrate that the failure case is ONLY in connection with IgnoreNonMapped(true), so for me, only the 4 tests where the config looks something like this are failing: Also, because I'm passing the created config in the scope of the tests, I don't think it's related to a global config setting (I created these repro examples in tests to try to rule out my own custom configurations). As a specific example, here's what the expression string generated by CreateMapToTargetExpression looks like for me at the end of the MapToTargetWithIgnoreNonMappedShouldNotContainBackingFields test (when I turn off the suggested fixes and revert the source code to its original state): |


Please note:
Changes: