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