コード例 #1
0
 public static CMSPage Get(string url)
 {
     return(FullPageTable.FirstOrDefault(x => x.URL == url) ??
            (GetByType("MainPage").FirstOrDefault() ?? new CMSPage()
     {
         URL = "main"
     }));
 }
コード例 #2
0
        public static string GetPageLinkByType(string typeName)
        {
            var type = new DB().PageTypes.FirstOrDefault(x => x.TypeName == typeName);

            return((type == null
                        ? new CMSPage()
            {
                FullUrl = "/"
            }
                        : (FullPageTable.FirstOrDefault(x => x.Type == type.ID) ?? new CMSPage()
            {
                FullUrl = "/"
            }))
                   .FullUrl);
        }
コード例 #3
0
 public static CMSPage Get(int ID)
 {
     return(FullPageTable.FirstOrDefault(x => x.ID == ID) ?? new CMSPage());
 }