You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello @nartc,
I'm curious about the purpose of the destination object in the resolver. Is there any way for e.g. User (title, first, last) to UserVm(first, last, fullName, fullTitle) where the mappings are:
The order of the mapping configurations is reversed (due to the reason we talked about on Discord). So if you want to access d.fullName in d.fullTitle, do the following:
d.fullName is configured last so it will be mapped first. If you were to use any Member Map that has access to destination object, you would have access to d.fullName.
Another approach is to use afterMap like following:
createMap(Source,Destination).forMember(d=>d.fullTitle,ignore())// we ignore it.forMember(d=>d.fullName, ...).afterMap((source,destination)=>{destination.fullTitle= ...;// map it here. At this moment, destination is ensured to have all manual-configured properties mapped.})
I'm going to close this issue until there's change in the future. If there is, I'll open a new issue to keep track. Thanks for the issue.
Hello @nartc,
I'm curious about the purpose of the destination object in the resolver. Is there any way for e.g. User (title, first, last) to UserVm(first, last, fullName, fullTitle) where the mappings are:
d.first -> s.first
d.last -> s.last
d.fullName -> s.first + ' ' + s.last
d.fullTitle -> s.title + ' ' + d.fullName
(option 1)I know there is always (option 2) where
d.fullTitle
can be defined ass.title + ' ' + s.first + ' ' + s.last
.I'm asking this to know if there is any possiblity to
The text was updated successfully, but these errors were encountered: