public Category GetCategory(string categoryId, CategoryEmbeds embeds = default(CategoryEmbeds))
        {
            var uri = GetCategoriesUri(string.Format("/{0}{1}", Uri.EscapeDataString(categoryId), embeds.ToString().ToParameters()));
            var result = baseClient.DoRequest(uri);

            return Category.Parse(baseClient, result.data);
        }
        public Category GetCategory(string categoryId, CategoryEmbeds embeds = default(CategoryEmbeds))
        {
            var uri    = GetCategoriesUri(string.Format("/{0}{1}", Uri.EscapeDataString(categoryId), embeds.ToString().ToParameters()));
            var result = baseClient.DoRequest(uri);

            return(Category.Parse(baseClient, result.data));
        }
        public Category GetCategoryFromSiteUri(string siteUri, CategoryEmbeds embeds = default(CategoryEmbeds))
        {
            var id = GetCategoryIDFromSiteUri(siteUri);

            if (string.IsNullOrEmpty(id))
                return null;

            return GetCategory(id, embeds);
        }
        public Category GetCategoryFromSiteUri(string siteUri, CategoryEmbeds embeds = default(CategoryEmbeds))
        {
            var id = GetCategoryIDFromSiteUri(siteUri);

            if (string.IsNullOrEmpty(id))
            {
                return(null);
            }

            return(GetCategory(id, embeds));
        }
        public ReadOnlyCollection<Category> GetCategories(
            string levelId, bool miscellaneous = true,
            CategoryEmbeds embeds = default(CategoryEmbeds),
            CategoriesOrdering orderBy = default(CategoriesOrdering))
        {
            var parameters = new List<string>() { embeds.ToString() };

            parameters.AddRange(orderBy.ToParameters());

            if (!miscellaneous)
                parameters.Add("miscellaneous=no");

            var uri = GetLevelsUri(string.Format("/{0}/categories{1}",
                Uri.EscapeDataString(levelId),
                parameters.ToParameters()));

            return baseClient.DoDataCollectionRequest<Category>(uri,
                x => Category.Parse(baseClient, x));
        }
Beispiel #6
0
        public ReadOnlyCollection <Category> GetCategories(
            string gameId, bool miscellaneous = true, CategoryEmbeds embeds = default, CategoriesOrdering orderBy = default)
        {
            var parameters = new List <string>()
            {
                embeds.ToString()
            };

            parameters.AddRange(orderBy.ToParameters());

            if (!miscellaneous)
            {
                parameters.Add("miscellaneous=no");
            }

            var uri = GetGamesUri(string.Format("/{0}/categories{1}", Uri.EscapeDataString(gameId), parameters.ToParameters()));

            return(baseClient.DoDataCollectionRequest(uri, x => Category.Parse(baseClient, x) as Category));
        }