using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
public static void Main()
var config = new MapperConfiguration(cfg => {
cfg.CreateMap<Child1, Child2>();
cfg.CreateMap<Parent, Child2>().ConstructUsing((src, ctx) => ctx.Mapper.Map<Child2>(src.Child1));
var mapper = config.CreateMapper();
var child2 = mapper.Map<Parent, Child2>(parent);
Console.WriteLine(child2.Id);
public Child1 Child1 {get;set;}