jjzjj

RedisCacheOptions

全部标签

c# - ASP.NET Core 2 - 多个 Azure Redis 缓存服务 DI

在ASP.NETCore2中,我们可以像这样添加一个AzureRedis缓存:services.AddDistributedRedisCache(config=>{config.Configuration=Configuration.GetConnectionString("RedisCacheConnection");config.InstanceName="MYINSTANCE";});那么用法是这样的:privatereadonlyIDistributedCache_cache;publicMyController(IDistributedCachecache){_cache=c