Ejemplo n.º 1
0
        /// <summary>
        /// Create a new instance based on the current <see cref="RemotingContext"/>
        /// </summary>
        /// <returns>An instance of <see cref="CustomHeaders"/> with headers populated using the current <see cref="RemotingContext"/></returns>
        public static CustomHeaders FromRemotingContext()
        {
            var customHeader = new CustomHeaders();

            foreach (var key in RemotingContext.Keys)
            {
                customHeader.Add(key, RemotingContext.GetData(key));
            }

            return(customHeader);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a new instance based on the current <see cref="RemotingContext"/>
        /// </summary>
        /// <returns>An instance of <see cref="CustomHeaders"/> with headers populated using the current <see cref="RemotingContext"/></returns>
        public static CustomHeaders FromRemotingContext()
        {
            var customHeader = new CustomHeaders();

            foreach (var key in RemotingContext.Keys.Where(k => k != MethodHeader))
            {
                customHeader.Add(key, RemotingContext.GetData(key).ToString());
            }

            return(customHeader);
        }