コード例 #1
0
        public List <FrontEndNavigationItem> GetFooterNavigation()
        {
            var navigationItemsCachKey = string.Format("Navigation_Footer_{0}", MicrositeId);

            var navigation = CacheProvider.GetFromCache <List <FrontEndNavigationItem> >(navigationItemsCachKey);

            if (navigation != null)
            {
                return(navigation);
            }

            //Only cache for the normal users
            navigation = NavigationService.GetNavigationBySiteAndSection(MicrositeId, "footer", CurrentLanguageId);

            //cache this for 5 mins
            if (navigation != null && navigation.Count > 0)
            {
                CacheProvider.AddToCache(navigationItemsCachKey, navigation, DateTime.Now.AddMinutes(5));
            }

            return(navigation);
        }