Mapping dicionários com AutoMapper
Dada essa classe, como posso mapear um dicionário dela
public class TestClass
{
public string Name { get; set; }
}
public class TestClassDto
{
public string Name { get; set; }
}
Mapper.CreateMap<TestClass, TestClassDto>();
Mapper.CreateMap<Dictionary<string, TestClass>,
Dictionary<string, TestClassDto>>();
var testDict = new Dictionary<string, TestClass>();
var testValue = new TestClass() {Name = "value1"};
testDict.Add("key1", testValue);
var mappedValue = Mapper.Map<TestClass, TestClassDto>(testValue);
var mappedDict = Mapper.Map<Dictionary<string, TestClass>,
Dictionary<string, TestClassDto>>(testDict);
Mapear um deles, mappedValue, neste caso, funciona be
O mapeamento de um dicionário deles acaba sem entradas no objeto de destin
O que estou fazend