0
新しいオブジェクト内のリストオブジェクトにマップする必要があるプロパティの辞書を持つデータベースオブジェクトがあります。AutoMapperを使用して辞書の値をリストにマップする
public class DbObject { // The source
public Dictionary<string, DbCustomProperty> customProperties;
}
public class DbCustomProperty {
public string Key;
public string Value;
}
public class DTOObject { // The destination
public List<DTOCustomProperty> DTOCustomProperties;
}
public class DTOCustomProperty {
public string Key;
public string Value;
}
あなたが見ることができるように、私はDTOObject(宛先)にDBOBJECT(ソース)をマッピングしたいと思います:私の構造(簡素化)は次のようになります。問題は、私のDBObjectに、リストにマップしたいプロパティが値である辞書が含まれていることです。
例えば、 dBObject.CustomProperties.Values - > dtoObject.CustomProperties
これはAutoMapperで認識できますか?
の可能性のある重複した[AutoMapper辞書フラット化](http://stackoverflow.com/questions/10519460/automapper-dictionary-flattening) –