Exemple #1
0
        public void Modify(BehaviorChain chain)
        {
            var outputType = OutputType();

            if (ShouldBeCached())
            {
                var cachingNode = new OutputCachingNode();
                AddBefore(cachingNode);

                ForAttributes <CacheAttribute>(x => x.Alter(cachingNode));

                if (outputType != null)
                {
                    outputType.ForAttribute <CacheAttribute>(att => att.Alter(cachingNode));
                }
            }


            if (outputType == null)
            {
                return;
            }

            if (outputType.CanBeCastTo <FubuContinuation>() || outputType.CanBeCastTo <IRedirectable>())
            {
                AddAfter(new ContinuationNode());
            }

            if (IsAsync)
            {
                AddAfter(outputType == typeof(Task)
                                  ? new AsyncContinueWithNode()
                                  : new AsyncContinueWithNode(outputType));
            }
        }
        private void addCaching(BehaviorChain chain)
        {
            var cacheNode = new OutputCachingNode {
                ETagCache   = ObjectDef.ForValue(_assetCache),
                OutputCache = ObjectDef.ForValue(_assetCache)
            };

            chain.AddToEnd(cacheNode);
        }
        private static void addCaching(BehaviorChain chain)
        {
            var cacheNode = new OutputCachingNode();

            chain.AddToEnd(cacheNode);
        }
 public void SetUp()
 {
     theNode = new OutputCachingNode();
 }