GetCategories() public static method

public static GetCategories ( ) : int>.Dictionary
return int>.Dictionary
Esempio n. 1
0
        /// <summary>
        /// Get site categories as an id list.
        /// </summary>
        /// <param name="site"></param>
        /// <returns></returns>
        public static List <int> GetCategoriesAsIdList(this Site site, int?parent, bool recursive = false)
        {
            ICollection <SiteClaim> cats = site.GetCategories(parent, recursive);

            return(cats?.Select(c => c.Id)?.ToList());
        }
Esempio n. 2
0
 /// <summary>
 /// Get all site categories.
 /// </summary>
 /// <param name="site"></param>
 /// <returns></returns>
 public static ICollection <SiteClaim> GetCategories(this Site site)
 {
     return(site.GetCategories(-1));
 }