Пример #1
0
        public List <Menus> GetMenu()
        {
            List <Menus> menuList = new List <Menus>();

            // System.Web.HttpContext.Current.Cache

            if (System.Web.HttpContext.Current.Cache["MenuList"] == null)
            {
                /*Read DB here and populate the list*/
                MenuBL menuBL = new MenuBL();
                menuList = menuBL.getMenuDetail();
                System.Web.HttpContext.Current.Cache["MenuList"] = menuList;
            }
            else
            {
                menuList = (List <Menus>)System.Web.HttpContext.Current.Cache["MenuList"];
            }

            //return PartialView("_Courses", courses);
            return(menuList);
        }