예제 #1
0
        private ICache GetCache(CacheConfig config)
        {
            ICache cache = null;
            var    normalisedCacheToUse = !string.IsNullOrWhiteSpace(config.CacheToUse) ? config.CacheToUse.ToLowerInvariant() : string.Empty;

            switch (normalisedCacheToUse)
            {
            case CacheTypes.MemoryCache:
                cache = new MemoryCacheAdapter(_logger);
                break;

            case CacheTypes.WebCache:
                cache = new WebCacheAdapter(_logger);
                break;

            case CacheTypes.AppFabricCache:
                cache = new AppFabricCacheAdapter(_logger, config);
                break;

            case CacheTypes.memcached:
                cache = new memcachedAdapter(_logger, config);
                break;

            case CacheTypes.redis:
                cache = new RedisCacheAdapter(_logger, config);
                break;

            default:
                cache = new MemoryCacheAdapter(_logger);
                break;
            }
            return(cache);
        }
예제 #2
0
 public void SetUp()
 {
     ca = AppFabricCacheAdapterFactory.Create("test_region");
 }
 public void SetUp()
 {
     ca = AppFabricCacheAdapterFactory.Create("test_region");
 }