public object Handle(IDictionary<string, object> sourceList, MapperConfig config) { string sourceName = config.SourceName.FirstOrDefault(); if (sourceName == null) throw new ArgumentException("Incorrect field name for mapped to {0}", config.DestinationName); string[] values = sourceList.FirstOrDefault(x => x.Key.Equals(sourceName)).Value as string[]; return string.Join(",", values); }
public object Handle(IDictionary<string, object> sourceList, MapperConfig config) { return config.SourceName.Select(x => Decimal.Parse(sourceList[x].ToString())).Aggregate<decimal, decimal>(0, (current, number) => current - number); }
public object Handle(IDictionary<string, object> sourceList, MapperConfig config) { return string.Join(" ", config.SourceName.Select(x => sourceList[x])); }
public object Handle(IDictionary<string, object> sourceList, MapperConfig config) { return sourceList[config.SourceName.First()]; }