What you currently have is a select N+1 scenario. Rather load all the rows you want from source and all the products you want from the destination database and join them in memory.
Register(new MyJoinOperatoin()
.Left(Partial.Register(new GetProducts("DataSource1")).new FormatSku()))
.Right(new GetDestProducts())
MyJoinOperation is an implementation of JoinOperation. I would assume you would want to left outer join so the implementation would look something like this
MyJoinOperation
{
protected Row Join(Row left, Row right)
{
var clone = left.Clone();
if(right.Contains("Sku"))
{
// sku exists in destination.
clone["action"] = "update";
...
}
else
{
// sku does not exist in destination
clone["action"] = "add";
...
}
return clone;
}
protected void SetupJoin()
{
LeftJoin.Left("Sku").Right("Sku");