示例#1
0
文件: CacheManager.cs 项目: tpx86/svz
 public RedisCacheProvider(SvzConfig config, string cacheName, int ttlSeconds)
 {
     _connection = ConnectionMultiplexer.Connect(config.Redis);
     _database   = _connection.GetDatabase();
     _cacheName  = cacheName;
     _ttlSeconds = ttlSeconds;
 }
示例#2
0
 public BookCacheValueSource(SvzConfig config)
 {
     _config = config;
 }
示例#3
0
文件: BookService.cs 项目: tpx86/svz
 public BookService()
 {
     _config = SvzConfig.GetConfig();
     _cache  = new CacheManager <int, BookView>(new BookCacheValueSource(_config),
                                                new RedisCacheProvider <int, BookView>(_config, "Svz", 15));
 }