I want to call a specific method xyz() on every property mapped by generic mapper configuration. Is this possible?
I am using Automapper v 9. Purpose is to call the method on each property mapped by Automapper to check add remove data at runtime.
public static IMapper CreateMapper<TSource, TDestination>()
{
var config = new MapperConfiguration(
cfg =>
{
cfg.Advanced.AllowAdditiveTypeMapCreation = true;
cfg.AllowNullDestinationValues = true;
cfg.AllowNullCollections = true;
cfg.CreateMap<TSource, TDestination>()
.PreserveReferences()
});
config.AssertConfigurationIsValid();
return config.CreateMapper();
}