/// <summary> /// Adds a global mapping function which will be executed for every property of the processed entities. /// The result of the <paramref name="mappingFunc"/> will be used to evaluate the value to be assigned to the processed property. /// </summary> /// <param name="mappingFunc">The mapping function</param> /// <returns></returns> public Config AddMapping(MapDelegate <object> mappingFunc) { if (GlobalMappings == null) { GlobalMappings = new List <MapDelegate <object> >(); } GlobalMappings.Add(mappingFunc); return(this); }
public virtual KeyValuePair <string, string> PerformNameLookup(List <string> row, int[] lookup) { var key = string.Empty; var val = string.Empty; if (lookup[0] > -1 && row.Count > lookup[0]) { key = row[lookup[0]]; } if (lookup[1] > -1 && row.Count > lookup[1]) { val = row[lookup[1]]; } if (val.IsNullOrEmpty()) { GlobalMappings.TryGetValue(key, out val); } return(new KeyValuePair <string, string>(key, val)); }