示例#1
0
        public void Invoke()
        {
            var input    = _fubuRequest.Get <TContextSupplier>();
            var contexts = input.GetContexts().ToDictionary(x => Guid.NewGuid(), x => x);

            foreach (var context in contexts)
            {
                _cmsContext.EnterContext(context.Key, context.Value);
            }

            _innerBehavior?.Invoke();

            foreach (var context in contexts)
            {
                _cmsContext.ExitContext(context.Key);
            }
        }
示例#2
0
            public void RenderTo(TextWriter writer)
            {
                foreach (var context in _requestContexts)
                {
                    _cmsContext.EnterContext(context.Key, context.Value);
                }

                _render(writer);

                foreach (var context in _requestContexts)
                {
                    _cmsContext.ExitContext(context.Key);
                }
            }