Scribd.Net.Category.GetCategories method

Retrieves category information from Scribd.


  • public static GetCategories(bool includeSubcategories)
  • public static GetCategories(int parentCategoryId)


  • bool includeSubcategories: Include subcategory information when fetching the list of categories.
  • int parentCategoryId: The Id of the category. This category's subcategories will be returned.

Return Value

  • System.Collection.Generic.ICollection<Category> : A list of categories

Usage Example

            // fetch all the top level categories
            System.Collections.Generic.ICollection<Scribd.Net.Category> topLevelNoKids = Scribd.Net.Category.GetCategories(false);

            foreach (Scribd.Net.Category cat in topLevelNoKids)
                // fetch any subcategories of 'cat'
                System.Collections.Generic.ICollection<Scribd.Net.Category> subCats = Scribd.Net.Category.GetCategories(cat.ID);
                if (subCats != null)

            // in the real world the above is more efficiently accomplished using:
            System.Collections.Generic.ICollection<Scribd.Net.Category> topLevelWithKids = Scribd.Net.Category.GetCategories(false);
            foreach (Scribd.Net.Category cat in topLevelWithKids)
                if (cat.SubCategories != null)

See Also

Last edited Aug 11, 2010 at 3:19 AM by peterjp, version 7


No comments yet.