【发布时间】:2019-03-29 19:50:40
【问题描述】:
我们正在使用 Microsoft 分布式缓存实现 .NET 核心。请参阅https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed?view=aspnetcore-2.1 了解更多信息。
现在我们可以通过下面的代码得到一个key。
var cacheKey = "application:customer:1234:profile";
var profile = _distributedCache.GetString(cacheKey);
我想做的是做以下事情:
var cacheKey = "application:customer:1234:*";
var customerData = _distributedCache.GetString(cacheKey);
这样我们就可以用这个模式得到以下键:
- 应用程序:客户:1234:个人资料
- 应用程序:客户:1234:订单
- 应用程序:客户:1234:发票
- 应用程序:客户:1234:付款
使用任何通配符或没有通配符都无法完成这项工作。有没有实现另一个 Redis nuget 包的解决方案?
【问题讨论】:
标签: asp.net-core redis .net-core asp.net-core-mvc