示例#1
0
 public static IEnumerable <CategoryInfo> GetMainCategories()
 {
     return(from item in CatalogHelper.GetCategories()
            where item.Depth == 1
            select item);
 }
示例#2
0
 public static CategoryInfo GetCategory(int categoryId)
 {
     return(CatalogHelper.GetCategories().FirstOrDefault((CategoryInfo item) => item.CategoryId == categoryId));
 }
示例#3
0
 public static IEnumerable <CategoryInfo> GetSubCategories(int parentCategoryId)
 {
     return(from item in CatalogHelper.GetCategories()
            where item.ParentCategoryId == parentCategoryId
            select item);
 }