Automapper map dictionary <string,string> to object

时间:2016-01-11 12:16:35

标签: c# string automapper

任何人都可以帮助如何将字典映射到类。使用我的下面的代码,我在第.ConvertUsing行收到错误,说“电话不明确......”

CreateMap<Dictionary<string,string>, CustomClass>()
    .ConvertUsing(x =>
    {
        var serializer = new JavaScriptSerializer();
        return serializer.Deserialize<CustomClass>(serializer.Serialize(x));
    });

由于

0 个答案:

没有答案