mapWith
Explicitly select and map a nested source value with registered model identifiers.
Use mapWith() when nested metadata cannot identify the mapping automatically or the source and destination member names differ.
forMember(
(destination) => destination.profile,
mapWith(ProfileDto, Profile, (source) => source.originalProfile),
);
Its arguments are:
- the nested destination identifier;
- the nested source identifier;
- a selector for the nested source value.
The corresponding Profile to ProfileDto mapping must already be registered.