/// <summary> /// Extracts identifier sets from a item listing JSON response. /// </summary> /// <param name="response">The <see cref="JObject"/> item listing response.</param> /// <returns>Identifiers of all formats of the items, their modular content items, taxonomies used in elements, underlying content types and eventually their elements (when present in the cache).</returns> public IEnumerable <CacheTokenPair> GetItemListingJsonResponseDependencies(JObject response) { var dependencies = new List <CacheTokenPair>(); if (KenticoCloudCacheHelper.IsDeliveryItemListingJsonResponse(response)) { foreach (dynamic item in response[KenticoCloudCacheHelper.ITEMS_IDENTIFIER].Children()) { dependencies.AddNonNullRange((IEnumerable <CacheTokenPair>)GetItemDependencies(item)); } foreach (var item in response[KenticoCloudCacheHelper.MODULAR_CONTENT_IDENTIFIER]?.Children()) { dependencies.AddNonNullRange(GetItemDependencies(item)); } } return(dependencies.Distinct()); }
/// <summary> /// Extracts identifier sets from a item listing JSON response. /// </summary> /// <param name="response">The <see cref="JObject"/> item listing response.</param> /// <returns>Identifiers of all formats of the items, their linked items items, taxonomies used in elements, underlying content types and eventually their elements (when present in the cache).</returns> public IEnumerable <IdentifierSet> GetContentItemListingJsonDependencies(JObject response) { var dependencies = new List <IdentifierSet>(); if (KenticoCloudCacheHelper.IsDeliveryItemListingJsonResponse(response)) { foreach (dynamic item in response[KenticoCloudCacheHelper.ITEMS_IDENTIFIER].Children()) { dependencies.AddNonNullRange((IEnumerable <IdentifierSet>)GetContentItemDependencies(item)); } foreach (var item in response[KenticoCloudCacheHelper.LINKED_ITEMS_IDENTIFIER]?.Children()) { dependencies.AddNonNullRange(GetContentItemDependencies(item)); } } return(dependencies.Distinct()); }