public static IEnumerable <KeyValuePair <string, string> > ToDictionary(this MessageHeaders source) { return(source.Headers .ToLookup(keyIs => keyIs.Key, valueIs => valueIs.Value) .ToDictionary(keyIs => keyIs.Key, valueIs => valueIs.FirstOrDefault())); }
public static void CopyFrom(this IDictionary <string, object> target, MessageHeaders source) { target.CopyFrom(source.ToDictionary()); }