示例#1
0
 /// <summary>
 /// Returns content items as JSON data.
 /// </summary>
 /// <param name="parameters">An array that contains zero or more query parameters, for example for filtering, ordering or depth of linked items.</param>
 /// <returns>The <see cref="JObject"/> instance that represents the content items. If no query parameters are specified, all content items are returned.</returns>
 public async Task <JObject> GetItemsJsonAsync(params string[] parameters)
 {
     return(await CacheManager.GetOrAddAsync(
                CacheHelper.GetItemsJsonKey(parameters),
                () => DeliveryClient.GetItemsJsonAsync(parameters),
                response => response["items"].Any()));
 }
        /// <summary>
        /// Returns content items as JSON data.
        /// </summary>
        /// <param name="parameters">An array that contains zero or more query parameters, for example for filtering, ordering or depth of linked items.</param>
        /// <returns>The <see cref="JObject"/> instance that represents the content items. If no query parameters are specified, all content items are returned.</returns>
        public async Task <JObject> GetItemsJsonAsync(params string[] parameters)
        {
            var identifierTokens = new List <string> {
                KenticoCloudCacheHelper.CONTENT_ITEM_LISTING_JSON_IDENTIFIER
            };

            identifierTokens.AddNonNullRange(parameters);

            return(await CacheManager.GetOrCreateAsync(
                       identifierTokens,
                       () => DeliveryClient.GetItemsJsonAsync(parameters),
                       response => response["items"].Count() <= 0,
                       GetContentItemListingJsonDependencies,
                       ProjectOptions.CreateCacheEntriesInBackground));
        }
 public Task <JObject> GetItemsJsonAsync(params string[] parameters)
 {
     return(_client.GetItemsJsonAsync(new[] { new LanguageParameter(_language).GetQueryStringParameter() }.Concat(parameters).ToArray()));
 }