string CreateInjectValue(bool isOutputMapping, FuzzyMatchVo fuzzyMatch, IDev2Definition def)
{
string injectValue;
// When output mapping we need to replace the recordset name if present with MasterRecordset
//
string masterRecordsetName;
if (isOutputMapping && def.IsRecordSet && fuzzyMatch != null)
{
var field = def.Name;
var recordsetName = fuzzyMatch.FetchMatch(def.Name, def.RecordSetName);
if (!string.IsNullOrEmpty(recordsetName))
{
masterRecordsetName = recordsetName;
}
else
{
// we have no match, use the current mapping value ;)
masterRecordsetName = def.RecordSetName;
}
injectValue = FormatString(masterRecordsetName, field);
}
else
{
if (def.IsRecordSet)
{
if (fuzzyMatch != null)
{
var recordsetName = fuzzyMatch.FetchMatch(def.Name, def.RecordSetName);
masterRecordsetName = !String.IsNullOrEmpty(recordsetName) ? recordsetName : def.RecordSetName;
}
else
{
masterRecordsetName = def.RecordSetName;
}
injectValue = FormatString(masterRecordsetName, def.Name);
}
else
{
injectValue = DataListUtil.AddBracketsToValueIfNotExist(def.Name);
}
}
return(injectValue);
}