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()); } }
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()); }