Exemplo n.º 1
0
        public List <Page> GetAllPages()
        {
            try
            {
                var results = Helpers.CacheHelper.GetDataFromCache <List <Page> >(Helpers.CacheHelperKeys.CK_ALL_PAGES, false);
                if (results == null || results.Count == 0)
                {
                    IContentRepository repos = new ContentRepository();

                    results = repos.FetchAllPages();

                    Helpers.CacheHelper.AddObjectToCache(Helpers.CacheHelperKeys.CK_ALL_PAGES, results, null, false, ApplicationEnums.CacheExpiration.Midnight);
                }


                return(results);
            }
            catch (Exception e)
            {
                throw;
            }
        }