コード例 #1
0
        public Page GetPage(ApplicationEnums.PageEnum page, bool useCache)
        {
            try
            {
                IContentRepository contentRepository = new ContentRepository();
                if (useCache)
                {
                    var pages = GetAllPages();
                    if (pages != null && pages.Count > 0)
                    {
                        var filteredPages = pages.Where(e => e.Name.ToUpper() == page.ToString().ToUpper());
                        if (filteredPages != null && filteredPages.Count() > 0)
                        {
                            return(filteredPages.First());
                        }
                    }
                }

                return(contentRepository.FetchPage(page));
            }
            catch (Exception e)
            {
                throw;
            }
        }