public ICachingStrategyConfiguration GetCachingStrategy(string strategyName)
        {
            if (!HasCachingStrategies)
            {
                return(null);
            }

            if (String.IsNullOrEmpty(strategyName))
            {
                strategyName = ((ISharpRepositoryConfiguration)this).DefaultCachingStrategy;
            }

            if (String.IsNullOrEmpty(strategyName))
            {
                return(null);
            }

            ICachingStrategyConfiguration strategyConfiguration = null;

            foreach (CachingStrategyElement element in CachingStrategies)
            {
                if (element.Name == strategyName)
                {
                    strategyConfiguration = element;
                    break;
                }
            }

            return(strategyConfiguration);
        }
Exemple #2
0
 protected ConfigCachingStrategyFactory(ICachingStrategyConfiguration config)
 {
     CachingStrategyConfiguration = config;
 }
Exemple #3
0
 public void AddCachingStrategy(ICachingStrategyConfiguration cachingStrategyConfiguration)
 {
     CachingStrategies.Add(cachingStrategyConfiguration);
 }
 public NoCachingConfigCachingStrategyFactory(ICachingStrategyConfiguration config)
     : base(config)
 {
 }
 public StandardConfigCachingStrategyFactory(ICachingStrategyConfiguration config)
     : base(config)
 {
 }
Exemple #6
0
 public TimeoutConfigCachingStrategyFactory(ICachingStrategyConfiguration config)
     : base(config)
 {
 }