Ejemplo n.º 1
0
 /// <summary>
 /// Returns taxonomy groups as JSON data.
 /// </summary>
 /// <param name="parameters">An array that contains zero or more query parameters, for example, for paging.</param>
 /// <returns>The <see cref="JObject"/> instance that represents the taxonomy groups. If no query parameters are specified, all taxonomy groups are returned.</returns>
 public async Task <JObject> GetTaxonomiesJsonAsync(params string[] parameters)
 {
     return(await CacheManager.GetOrAddAsync(
                CacheHelper.GetTaxonomiesJsonKey(parameters),
                () => DeliveryClient.GetTaxonomiesJsonAsync(parameters),
                response => response["taxonomies"].Any()));
 }
        /// <summary>
        /// Returns taxonomy groups as JSON data.
        /// </summary>
        /// <param name="parameters">An array that contains zero or more query parameters, for example, for paging.</param>
        /// <returns>The <see cref="JObject"/> instance that represents the taxonomy groups. If no query parameters are specified, all taxonomy groups are returned.</returns>
        public async Task <JObject> GetTaxonomiesJsonAsync(params string[] parameters)
        {
            var identifierTokens = new List <string> {
                KenticoCloudCacheHelper.TAXONOMY_GROUP_LISTING_JSON_IDENTIFIER
            };

            identifierTokens.AddNonNullRange(parameters);

            return(await CacheManager.GetOrCreateAsync(
                       identifierTokens,
                       () => DeliveryClient.GetTaxonomiesJsonAsync(parameters),
                       response => response["taxonomies"].Count() <= 0,
                       GetTaxonomyListingJsonDependencies,
                       ProjectOptions.CreateCacheEntriesInBackground));
        }
 public Task <JObject> GetTaxonomiesJsonAsync(params string[] parameters)
 {
     return(_client.GetTaxonomiesJsonAsync(parameters));
 }