示例#1
0
        public static string GetProperty(string key)
        {
            var httpContextBuffer = HttpRequestAppender.GetHttpContextBuffer(true);

            if (SaveInHttpContext && httpContextBuffer != null)
            {
                return(httpContextBuffer[key]);
            }

            return((string)LogicalThreadContext.Properties[key]);
        }
示例#2
0
        public static void SetProperty(string key, string value)
        {
            var httpContextBuffer = HttpRequestAppender.GetHttpContextBuffer(true);

            if (SaveInHttpContext && httpContextBuffer != null)
            {
                httpContextBuffer[key] = value;
            }
            else
            {
                LogicalThreadContext.Properties[key] = value;
            }
        }