Ejemplo n.º 1
0
        public List <Link> GetAllLinks()
        {
            try
            {
                var results = Helpers.CacheHelper.GetDataFromCache <List <Link> >(Helpers.CacheHelperKeys.CK_ALL_LINKS, false);
                if (results == null || results.Count == 0)
                {
                    IContentRepository repos = new ContentRepository();

                    results = repos.FetchAllLinks();

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


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