コード例 #1
0
 public static ICacheServiceBuilder AddMemoryCache(this ICacheServiceBuilder serviceBuilder)
 {
     return(serviceBuilder.AddCacheProvider((configuration) =>
     {
         return MemoryCacheProvider.Default;
     }));
 }
コード例 #2
0
 public static ICacheServiceBuilder AddRedisCache(this ICacheServiceBuilder serviceBuilder, ConfigurationOptions configOptions)
 {
     return(serviceBuilder.AddCacheProvider((configuration) =>
     {
         return new RedisCacheProvider(configOptions, configuration.Serializer);
     }));
 }
コード例 #3
0
 public static ICacheServiceBuilder AddMemoryCache(this ICacheServiceBuilder serviceBuilder, string name)
 {
     return(serviceBuilder.AddCacheProvider((configuration) =>
     {
         return new MemoryCacheProvider(name);
     }));
 }
コード例 #4
0
 private static ICacheServiceBuilder AddRedisCacheBySentinel(this ICacheServiceBuilder serviceBuilder, IRedisSentinelManager sentinelManager,
                                                             Action <ConfigurationOptions> configurationSettings)
 {
     return(serviceBuilder.AddCacheProvider((configuration) =>
     {
         return sentinelManager.GetRedisCacheProvider(configurationSettings, configuration.Serializer);
     }));
 }