Is there a way to get the current mapping context in AutoMapper when using AfterMap?
public class DefaultMappingProfile : Profile
{
protected override void Configure()
{
this.CreateMap<SomeList, List<SpecialItem>>()
.AfterMap((src, dst) => dst.AddRange(
src.elem.Select(Mapper.Map<SpecialItem>)));
I tried to use .ConstructUsing(context => {})
but this gave me not the same results as when using AfterMap (!?). But I don't want to access the global variable Mapper
here. Is there a way to get around accessing the global variable here?