예제 #1
0
 public CmsPage LoadDefault()
 {
     try
     {
         CmsSetting defaultSetting = settingData.Get(Constant.Settings.DefaultPageId);
         return(Load(defaultSetting.GetIntValue()));
     }
     catch (Exception ex)
     {
         log.Warn(ex.Message);
         return(pageData.LoadAll().FirstOrDefault());
     }
 }
예제 #2
0
        public IEnumerable <CmsPage> LoadLastCreated()
        {
            int numberOfLastPageToLoad = 10;

            try
            {
                CmsSetting lastCreated = settingData.Get(Constant.Settings.LastCreated);
                if (lastCreated != null)
                {
                    numberOfLastPageToLoad = lastCreated.GetIntValue();
                }
            }
            catch (Exception ex)
            {
                log.Info(ex.Message);
            }

            IEnumerable <CmsPage> lastPages = pageData.LoadLast(numberOfLastPageToLoad);
            int defaultPageid = LoadDefault().Id;

            lastPages = lastPages.Where(x => x.Id != defaultPageid);
            return(lastPages.ToList());
        }