Exemple #1
0
        public async void GetTaxonomiesAsync()
        {
            var response = await client.GetTaxonomiesAsync(new SkipParameter(1));

            Assert.NotNull(response.ApiUrl);
            Assert.NotEmpty(response.Taxonomies);
        }
Exemple #2
0
        /// <summary>
        /// Returns taxonomy groups.
        /// </summary>
        /// <param name="parameters">A collection of query parameters, for example, for paging.</param>
        /// <returns>The <see cref="DeliveryTaxonomyListingResponse"/> instance that represents the taxonomy groups. If no query parameters are specified, all taxonomy groups are returned.</returns>
        public async Task <DeliveryTaxonomyListingResponse> GetTaxonomiesAsync(IEnumerable <IQueryParameter> parameters)
        {
            var queryParameters = parameters?.ToList();

            return(await CacheManager.GetOrAddAsync(
                       CacheHelper.GetTaxonomiesKey(queryParameters),
                       () => DeliveryClient.GetTaxonomiesAsync(queryParameters),
                       response => response.Taxonomies.Any()));
        }
Exemple #3
0
        public async void GetTaxonomiesAsync()
        {
            mockHttp.When($"{baseUrl}/taxonomies").
            WithQueryString("skip=1").
            Respond("application/json", File.ReadAllText(Path.Combine(AppContext.BaseDirectory, "Fixtures\\DeliveryClient\\taxonomies_multiple.json")));

            DeliveryClient client = InitializeDeliverClientWithACustomeTypeProvider();

            var response = await client.GetTaxonomiesAsync(new SkipParameter(1));

            Assert.NotNull(response.ApiUrl);
            Assert.NotEmpty(response.Taxonomies);
        }
        /// <summary>
        /// Returns taxonomy groups.
        /// </summary>
        /// <param name="parameters">A collection of query parameters, for example, for paging.</param>
        /// <returns>The <see cref="DeliveryTaxonomyListingResponse"/> instance that represents the taxonomy groups. If no query parameters are specified, all taxonomy groups are returned.</returns>
        public async Task <DeliveryTaxonomyListingResponse> GetTaxonomiesAsync(IEnumerable <IQueryParameter> parameters)
        {
            var identifierTokens = new List <string> {
                KenticoCloudCacheHelper.TAXONOMY_GROUP_LISTING_IDENTIFIER
            };

            identifierTokens.AddNonNullRange(KenticoCloudCacheHelper.GetIdentifiersFromParameters(parameters));

            return(await CacheManager.GetOrCreateAsync(
                       identifierTokens,
                       () => DeliveryClient.GetTaxonomiesAsync(parameters),
                       response => response.Taxonomies.Count <= 0,
                       GetTaxonomyListingDependencies,
                       ProjectOptions.CreateCacheEntriesInBackground));
        }
 public Task <DeliveryTaxonomyListingResponse> GetTaxonomiesAsync(params IQueryParameter[] parameters)
 {
     return(_client.GetTaxonomiesAsync(parameters));
 }