Exemple #1
0
        private static CacheInfo InitLayout( MvcContext ctx, ControllerBase controller, Boolean isLayout )
        {
            CacheInfo ci = new CacheInfo();

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

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

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

            IActionCache actionCache = ControllerMeta.GetActionCache( controller.GetType(), ci._actionName );
            ci.initCacheKey( actionCache, ctx );

            return ci;
        }