using System.Collections.Generic;
public static void Main()
cfg.CreateMap<RemoteAgent, MySystem>().AfterMap<MapDictionary>();
RemoteAgent remAge = new RemoteAgent();
remAge.testMappingNormalAttr = "normalAttr";
remAge.Add("testKey"," testValue");
remAge.Add("testKey2"," testValue2");
var res = Mapper.Map(remAge,typeof(RemoteAgent),typeof(MySystem));
var resAsDict = res as Dictionary<string,string>;
Helper helper = new Helper();
Console.WriteLine(helper.GetValueFromProp(res,"testMappingNormalAttr").Equals(remAge.testMappingNormalAttr));
Console.WriteLine(remAge.Keys.ToList().Count() == resAsDict.Keys.ToList().Count());
public object GetValueFromProp(object obj, string property){
return obj.GetType().GetProperty(property).GetValue(obj,null);
public class RemoteAgent : Dictionary<string, string>
public string testMappingNormalAttr { get; set;}
public class MySystem: Dictionary<string, string>
public string testMappingNormalAttr { get; set;}
public class MapDictionary : IMappingAction<RemoteAgent, MySystem>
public void Process(RemoteAgent src, MySystem dest)
foreach (var item in Enumerable.Zip(src.Keys, src.Values, (one, two) => Tuple.Create(one, two)))
dest.Add(item.Item1, item.Item2);