예제 #1
0
 /// <summary>
 /// Returns a taxonomy group as JSON data.
 /// </summary>
 /// <param name="codename">The codename of a taxonomy group.</param>
 /// <returns>The <see cref="JObject"/> instance that represents the taxonomy group with the specified codename.</returns>
 public async Task <JObject> GetTaxonomyJsonAsync(string codename)
 {
     return(await CacheManager.GetOrAddAsync(
                CacheHelper.GetTaxonomyJsonKey(codename),
                () => DeliveryClient.GetTaxonomyJsonAsync(codename),
                response => response != null));
 }
        /// <summary>
        /// Returns a taxonomy group as JSON data.
        /// </summary>
        /// <param name="codename">The codename of a taxonomy group.</param>
        /// <returns>The <see cref="JObject"/> instance that represents the taxonomy group with the specified codename.</returns>
        public async Task <JObject> GetTaxonomyJsonAsync(string codename)
        {
            var identifierTokens = new List <string> {
                KenticoCloudCacheHelper.TAXONOMY_GROUP_SINGLE_JSON_IDENTIFIER, codename
            };

            return(await CacheManager.GetOrCreateAsync(
                       identifierTokens,
                       () => DeliveryClient.GetTaxonomyJsonAsync(codename),
                       response => response == null,
                       GetTaxonomySingleJsonDependency,
                       ProjectOptions.CreateCacheEntriesInBackground));
        }
 public Task <JObject> GetTaxonomyJsonAsync(string codename)
 {
     return(_client.GetTaxonomyJsonAsync(codename));
 }