I need to map a list from destination object to source, using a public method on the source object.
e.g.
public class Destination
{
private IList<int> List = new List<int>();
public void Add(int i) { List.Add(i); }
}
public class Source
{
public int[] List { get; set; }
}
So in pseudo-pseudo language the mapping should be:
Mapper.CreateMap foreach item in Source.List, invoke Source.Add(item)
Can this be done?
Yes. Use the ConvertUsing syntax: