447 questions
you can use IValueResolver to implement custom mapping
public class CustomPropertyMapping
: IValueResolver<Source, Destination, int>
{
public decimal Resolve(Source source,
DestinationDto destination, int value,
ResolutionContext context)
{
if (condition met)
return property1;
else
return property2
}
}
and in configuration
CreateMap>Source, DestinationDto>()
.ForMember(dest => dest.property,
source => source.MapFrom<CustomPropertyMapping>())
for more details on see custom property mapping using AutoMapper