using System.Collections.Generic;
public static void Main()
var config = new MapperConfiguration(cfg => {
cfg.CreateMap<FromClass, ToClass>()
.ForMember(i=>i.Foreigns, o=>o.MapFrom((s,to, tp, ctx)=>{
tp.Add((LocalId:to?.Id??0,ForeignIds:101));
var mapper=config.CreateMapper();
var to=new ToClass{ Foreigns=new []{(LocalId:1, ForeignIds:100)}.ToList() };
mapper.Map(new FromClass{Foreigns=new int[]{1,2,3}.ToList()}, to);
Console.WriteLine(to.Foreigns.Count());
public List<(int LocalId, int ForeignId)> Foreigns {get;set;}
public List<int> Foreigns{get;set;}