public L2CacheTest()
        {
            IServiceCollection services = new ServiceCollection();

            services.AddMemoryServices(options =>
            {
                options.DBConfig.SizeLimit = 100;
                options.DBConfig.ExpirationScanFrequency = 10;
            });
            services.AddRedisServices(options =>
            {
                options.DBConfig.Password = "******";
                options.DBConfig.Endpoints.Add(new Cache.Core.Configurations.ServerEndPoint()
                {
                    Port = 6379,
                    Host = "r-wz952aaada291544pd.redis.rds.aliyuncs.com"
                });
            }).AddRedisL2Services()
            ;
            services.AddLogging();
            IServiceProvider        serviceProvider = services.BuildServiceProvider();
            ICachingProviderFactory _factory        = serviceProvider.GetService <ICachingProviderFactory>();

            _provider        = _factory.GetCachingProvider(CachingConstValue.DefaultInMemoryName);
            _redis           = _factory.GetCachingProvider(CachingConstValue.DefaultRedisName);
            _l2CacheProvider = serviceProvider.GetService <IL2CacheProvider>();
            _defaultTs       = TimeSpan.FromSeconds(600);
        }
 public HomeController(ICachingProviderFactory providerFactory,
                       IL2CacheProvider l2CacheProvider)
 {
     _providerFactory = providerFactory;
     _l2CacheProvider = l2CacheProvider;
     _memoryProvider  = _providerFactory.GetCachingProvider(CachingConstValue.DefaultInMemoryName);
     _redisProvider   = _providerFactory.GetCachingProvider(CachingConstValue.DefaultRedisName);
 }