public class ChildSourceBase
public class ChildDestinationBase
public ParentDestination Parent { get; set; } = null!;
public class ChildSourceMiddle : ChildSourceBase
public class ChildDestinationDerived : ChildDestinationBase
public class ChildSourceDerived : ChildSourceMiddle
public class ParentSourceBase
public class ParentDestination
public ChildDestinationBase Child { get; set; } = null!;
public class ParentSourceDerived : ParentSourceBase
public ChildSourceDerived Child { get; set; } = null!;
public static void Main()
var config = new MapperConfiguration(cfg => {
cfg.CreateMap<ParentSourceBase, ParentDestination>()
.ForMember(dest => dest.Child, opt => opt.Ignore());
cfg.CreateMap<ParentSourceDerived, ParentDestination>()
.IncludeBase<ParentSourceBase, ParentDestination>()
.ForMember(dest => dest.Child, opt => opt.MapFrom(src => src.Child))
cfg.CreateMap<ChildSourceBase, ChildDestinationBase>()
.ForMember(dest => dest.Parent, opt => opt.Ignore());
cfg.CreateMap<ChildSourceMiddle, ChildDestinationDerived>()
.IncludeBase<ChildSourceBase, ChildDestinationBase>();
cfg.CreateMap<ChildSourceDerived, ChildDestinationDerived>()
.IncludeBase<ChildSourceMiddle, ChildDestinationDerived>();
config.AssertConfigurationIsValid();