AutoMapper handles this key-value pair scenario out of the box.
Mapper.CreateMap<Source, Dest>()
.ForMember(d => d.Foo, opt => opt.ResolveUsing(res => res.Context.Options.Items["Foo"]));
Then at runtime:
Mapper.Map<Source, Dest>(src, opt => opt.Items["Foo"] = "Bar");
A bit verbose to dig into the context items but there you go.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…