Exemplo n.º 1
0
        public dynamic OnLoad()
        {
            string keyCache   = "_CAdv_" + MenuID + "_";
            var    cachevalue = CacheExtends.GetDataFromCache <dynamic>(keyCache);

            if (cachevalue != null && cachevalue.Data != null)
            {
                return(cachevalue);
            }
            else
            {
                ViewBag.Title = Title;
                var data  = ChildNodes.GetChildMenuByRoot(MenuID);
                var cache = _advService.CreateQuery().Find(o => o.Activity == true && data.IndexOf(o.MenuID) > -1).ToList();
                ViewBag.Data = cache;
                CacheExtends.SetObjectFromCache(keyCache, 120, ViewBag);
                return(ViewBag);
            }
        }