/// <summary> /// Returns a content type as JSON data. /// </summary> /// <param name="codename">The codename of a content type.</param> /// <returns>The <see cref="JObject"/> instance that represents the content type with the specified codename.</returns> public async Task <JObject> GetTypeJsonAsync(string codename) { return(await CacheManager.GetOrAddAsync( CacheHelper.GetTypeJsonKey(codename), () => DeliveryClient.GetTypeJsonAsync(codename), response => response != null)); }
/// <summary> /// Returns a content type as JSON data. /// </summary> /// <param name="codename">The codename of a content type.</param> /// <returns>The <see cref="JObject"/> instance that represents the content type with the specified codename.</returns> public async Task <JObject> GetTypeJsonAsync(string codename) { var identifierTokens = new List <string> { KenticoCloudCacheHelper.CONTENT_TYPE_SINGLE_JSON_IDENTIFIER, codename }; return(await CacheManager.GetOrCreateAsync( identifierTokens, () => DeliveryClient.GetTypeJsonAsync(codename), response => response == null, GetTypeSingleJsonDependencies, ProjectOptions.CreateCacheEntriesInBackground)); }
public Task <JObject> GetTypeJsonAsync(string codename) { return(_client.GetTypeJsonAsync(codename)); }