Example #1
0
        private static ActionCacheChecker initPrivate( MvcContext ctx, ControllerBase controller, Boolean isLayout )
        {
            ActionCacheChecker x = new ActionCacheChecker();

            if (MvcConfig.Instance.IsActionCache == false) return x;

            // 模拟的context环境下,不缓存
            if (ctx.web.GetType() != typeof( WebContext )) return x;

            x._actionName = isLayout ? "Layout" : ctx.route.action;

            ActionCache actionCache = ControllerMeta.GetActionCacheAttr( controller.GetType(), x._actionName );
            x.initCacheKey( actionCache, ctx );

            return x;
        }
Example #2
0
        private static ActionCacheChecker initPrivate(MvcContext ctx, ControllerBase controller, Boolean isLayout)
        {
            ActionCacheChecker x = new ActionCacheChecker();

            if (MvcConfig.Instance.IsActionCache == false)
            {
                return(x);
            }

            // 模拟的context环境下,不缓存
            if (ctx.web.GetType() != typeof(WebContext))
            {
                return(x);
            }

            x._actionName = isLayout ? "Layout" : ctx.route.action;

            ActionCache actionCache = ControllerMeta.GetActionCacheAttr(controller.GetType(), x._actionName);

            x.initCacheKey(actionCache, ctx);


            return(x);
        }