GetDependencyCacheKeys is missing in Kentico 10

Tomasz Czado asked on July 13, 2017 14:45

Hi,

how to replace this code in Kentico 10 since GetDependencyCacheKeys was removed?

var nodeDependencies = TreeProvider.GetDependencyCacheKeys(rootDoc, SiteContext.CurrentSiteName);
cs.CacheDependency = CacheHelper.GetCacheDependency(nodeDependencies);

Thanks for help.

Correct Answer

Michal Samuhel answered on July 17, 2017 15:37

I was in touch with Tomasz, and mentioned method was indeed from another class. We had moved document cache key generation to a sealed class DocumentDependencyCacheKeysBuilder. So:

DocumentDependencyCacheKeysBuilder.GetDependencyCacheKeys()

Should be used in these cases.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on July 13, 2017 16:39

According to documentation:

The type or member was never intended for public use. Please contact Kentico support if you need to find a replacement.

Have you contacted support regarding this?

0 votesVote for this answer Mark as a Correct answer

Tomasz Czado answered on July 13, 2017 20:26 (last edited on July 13, 2017 20:30)

They answered:


You could GetCacheDependencies method instead and ironically enough this was, what this method was doing:

[Obsolete("Use GetCacheDependencies() instead.")]
protected virtual List<string> GetDependencyCacheKeys(string key, string context)
{
    return GetCacheDependencies();
}

cs.CacheDependency = CacheHelper.GetCacheDependency(nodeDependencies);


This is what they told me and at this moment is incomprehensible to me because I'm still not sure, what to use to update this code. I need a list of keys for the tree node object so then I can put it to CacheHelper.GetCacheDependency(...) method.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.