コード例 #1
0
 public RedisCacheProvider(IRedisDatabaseProvider databaseProvider, RedisCacheOptions options)
 {
     _databaseProvider = databaseProvider;
 }
コード例 #2
0
 public RedisConnectionProvider(RedisCacheOptions redisCacheOptions)
 {
     _redisCacheOptions = redisCacheOptions;
 }
コード例 #3
0
        public static IServiceCollection UseRedisCache(this IServiceCollection serviceCollection, RedisCacheOptions redisCacheOptions)
        {
            serviceCollection.AddSingleton(redisCacheOptions);

            serviceCollection.AddSingleton <IRedisConnectionProvider, RedisConnectionProvider>();
            serviceCollection.AddSingleton <IRedisDatabaseProvider, RedisDatabaseProvider>();
            serviceCollection.AddSingleton <ICacheProvider, RedisCacheProvider>();
            serviceCollection.AddSingleton <ICacheMapProvider, RedisCacheMapProvider>();

            return(serviceCollection);
        }