Beispiel #1
0
        protected Dictionary <string, string> CollectProperties(MessageProperties properties)
        {
            if (properties == null || properties.Count == 0)
            {
                return(null);
            }

            // For HttpRequest/ResponseMessageProperty and RemoteEndpointMessageProperty properties we have dedicated fields
            Dictionary <string, string> target = new Dictionary <string, string>();

            foreach (var property in properties.Where(x => x.Key != HttpRequestMessageProperty.Name &&
                                                      x.Key != HttpResponseMessageProperty.Name && x.Key != RemoteEndpointMessageProperty.Name))
            {
                var value = property.Value.ToString();
                if (value == property.Value.GetType().ToString())
                {
                    continue;
                }

                target[property.Key.ToLowerInvariant()] = value;
            }

            return(target);
        }