Conditional mapping #1726
fubar-coder
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
let's assume that you have the following object:
Now I'd like to create an "update" mapping:
The problem is that the properties
InvoiceName1
, etc. should only be copied whenHasInvoiceAddress
has a value oftrue
.Reading the mapping condition from a property might not be enough, when the condition might be more complex. A
MappingConditionFromSourceAttribute
might be a solution:It might also be useful to have an override for
AllowNullPropertyAssignment
on the newMappingConditionFromSourceAttribute
andMappingConditionPropertyAttribute
, which would force copying the values even though the source value might benull
.Beta Was this translation helpful? Give feedback.
All reactions