Data Synchronisation Studio's Dynamic Columns makes it really easy to lookup Data in a remote system to Lookup Data and decorate the source Row with the value.
For example we have this simple set of currency data, this contains an ID, Currency Name and Value. However our target Database requires an ID value for the Currency Name so we need to transform this with a Dynamic Column.
Data Sync includes the excellent Massive Data Access library and by using this it's really easy to create a Lookup Dictionary that you can use to lookup the Currency ID.
#region Usings
using System;
using System.Linq;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.Text;
using Simego.DataSync.Helpers.Massive;
#endregion
class DataSourceRowOverride : Simego.DataSync.DynamicColumns.DataSourceRowInternal //Do Not Change This Line
{
private dynamic currencyLookup;
public object CurrencyID
{
get { return currencyLookup.ContainsKey(CurrencyName) ? currencyLookup[CurrencyName].ID : null; }
}
public override void Setup()
{
currencyLookup = new DynamicModel(DataSourceB.Settings["ConnectionString"], "Currency").All().ToDictionary(k => k.CurrencyName);
}
}
Then it's just a simple case of mapping the Dynamic CurrencyID column to the target.