public static ICacheServiceBuilder AddMemoryCache(this ICacheServiceBuilder serviceBuilder) { return(serviceBuilder.AddCacheProvider((configuration) => { return MemoryCacheProvider.Default; })); }
public static ICacheServiceBuilder AddRedisCache(this ICacheServiceBuilder serviceBuilder, ConfigurationOptions configOptions) { return(serviceBuilder.AddCacheProvider((configuration) => { return new RedisCacheProvider(configOptions, configuration.Serializer); })); }
public static ICacheServiceBuilder AddMemoryCache(this ICacheServiceBuilder serviceBuilder, string name) { return(serviceBuilder.AddCacheProvider((configuration) => { return new MemoryCacheProvider(name); })); }
private static ICacheServiceBuilder AddRedisCacheBySentinel(this ICacheServiceBuilder serviceBuilder, IRedisSentinelManager sentinelManager, Action <ConfigurationOptions> configurationSettings) { return(serviceBuilder.AddCacheProvider((configuration) => { return sentinelManager.GetRedisCacheProvider(configurationSettings, configuration.Serializer); })); }