public static void ReplaceMultiple(this IBaseMessage pInMsg, Dictionary <string, string> replacementMap) { var dict = new Dictionary <string, Func <string, string> >(); foreach (var item in replacementMap) { dict.Add(item.Key, x => item.Value); } pInMsg.Mutate(dict); }
public static void FindReplaceMultiple(this IBaseMessage pInMsg, Dictionary <string, KeyValuePair <string, string> > replacementMap) { var dict = new Dictionary <string, Func <string, string> >(); foreach (var item in replacementMap) { dict.Add(item.Key, x => { return(x.Replace(item.Value.Key, item.Value.Value)); }); } pInMsg.Mutate(dict); }