CreateMap<OddData, IEnumerable<Poco>>()
.ConvertUsing(src => {
var PocoList = new List<Poco>();
for(int i=0;i<src.NBOCCURENCE;i++)
{
PocoList.Add(new Poco{
Property1 = src.PROPERTY1[i],
Property2 = src.PROPERTY2[i],
});
}
return PocoList;
});
var pocoList = Mapper.Map<OddData, IEnumerable<Poco>>(oddData);
There you go. Remember, AutoMapper is about mapping things that look the same. When things don't look the same, you do this. Which I'm not sure is an improvement at all. It just adds indirection (unless this is part of a broader mapping configuration).