public static SitecoreCachingConfigBuilder ConfigureCache <T>(
     this SitecoreCachingConfigBuilder configBuilder,
     string storeName,
     CacheEntryPriority?defaultEntryPriority = null)
 {
     return(configBuilder.ConfigureCaches(WildcardMatch.Named <T>(), storeName, defaultEntryPriority));
 }
 public static SitecoreCachingConfigBuilder ConfigureCaches <T1, T2>(
     this SitecoreCachingConfigBuilder configBuilder,
     string storeName,
     CacheEntryPriority?defaultEntryPriority = null)
 {
     configBuilder.ConfigureCache <T1>(storeName, defaultEntryPriority);
     return(configBuilder.ConfigureCache <T2>(storeName, defaultEntryPriority));
 }
        public static SitecoreCachingConfigBuilder ConfigureCaches(
            this SitecoreCachingConfigBuilder configBuilder,
            IEnumerable <string> cacheNamePatterns,
            string storeName,
            CacheEntryPriority?defaultEntryPriority = null)
        {
            Condition.Requires(cacheNamePatterns, nameof(cacheNamePatterns)).IsNotNull();

            foreach (var cacheNamePattern in cacheNamePatterns)
            {
                configBuilder.ConfigureCaches(cacheNamePattern, storeName, defaultEntryPriority);
            }
            return(configBuilder);
        }
        public static SitecoreCachingConfigBuilder ConfigureCaches(
            this SitecoreCachingConfigBuilder configBuilder,
            WildcardMatch cacheNamePattern,
            string storeName,
            CacheEntryPriority?defaultEntryPriority = null)
        {
            Condition.Requires(cacheNamePattern, nameof(cacheNamePattern)).IsNotNull();
            Condition.Requires(storeName, nameof(storeName)).IsNotNullOrWhiteSpace();

            return(configBuilder.ConfigureCaches(cacheNamePattern, o =>
            {
                o.StoreName = storeName;
                if (defaultEntryPriority != null)
                {
                    o.EntryPriority = defaultEntryPriority.Value;
                }
            }));
        }