private static CMSCacheDependency GetCacheDependency(string[] dependencyCacheKeys, IEnumerable <BaseInfo> objects) { var objectType = objects.First().TypeInfo.ObjectType; dependencyCacheKeys = dependencyCacheKeys ?? new[] { CacheDependencyKeyProvider.GetDependencyCacheKeyForObjectType(objectType) } ; return(CacheHelper.GetCacheDependency(dependencyCacheKeys)); }
private static CMSCacheDependency GetPagesCacheDependency(string[] dependencyCacheKeys, IEnumerable <TreeNode> pages) { var className = pages.First().ClassName; dependencyCacheKeys = dependencyCacheKeys ?? new[] { CacheDependencyKeyProvider.GetDependencyCacheKeyForPageType(SiteContext.CurrentSiteName, className), CacheDependencyKeyProvider.GetDependencyCacheKeyForObjectType(className) }; var keys = new HashSet <string>(dependencyCacheKeys, StringComparer.OrdinalIgnoreCase); var pathKeys = pages.Where(page => page.HasUrl()) .Select(page => page.NodeAliasPath) .SelectMany(path => DocumentDependencyCacheKeysBuilder.GetParentPathsDependencyCacheKeys(SiteContext.CurrentSiteName, path)) .Distinct(); foreach (var pathKey in pathKeys) { keys.Add(pathKey); } return(CacheHelper.GetCacheDependency(keys)); }