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);
        }
Exemplo n.º 2
0
 protected ConfigCachingStrategyFactory(ICachingStrategyConfiguration config)
 {
     CachingStrategyConfiguration = config;
 }
Exemplo n.º 3
0
 public void AddCachingStrategy(ICachingStrategyConfiguration cachingStrategyConfiguration)
 {
     CachingStrategies.Add(cachingStrategyConfiguration);
 }
 public NoCachingConfigCachingStrategyFactory(ICachingStrategyConfiguration config)
     : base(config)
 {
 }
 public StandardConfigCachingStrategyFactory(ICachingStrategyConfiguration config)
     : base(config)
 {
 }
Exemplo n.º 6
0
 public TimeoutConfigCachingStrategyFactory(ICachingStrategyConfiguration config)
     : base(config)
 {
 }