ASP.NET Core MemoryCache-使用中的更新项

realPro

我找不到有关如何正确更新现有缓存项目的任何信息。我需要在更新之前锁定它吗?

如果用户遍历ListOFStuff缓存项和其他一些任务,在读取期间将其设置为新值,会发生什么情况?

cache.Set(“LS”, ListOFStuff);
尤金

根据MSDN, MemoryCache是​​线程安全的,因此不必自己实现线程安全。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

ASp .Net Core Web API中的多个MemoryCache

如何使用 MemoryCache 类在 asp.net core 中缓存和获取列表

ASP.NET CORE 使用 MemoryCache 或类似方法发送缓存副本

Asp.Net Core:为集成测试重置 memoryCache

ASP.NET Core 2.1-实现MemoryCache时出错

.Net Core MemoryCache PostEvictionCallback无法正常工作

Net Core MemoryCache不会按请求重置

在 .net core mvc 2.1 中使用 MemoryCache 并将应用程序部署在 azure WebApp 上

在asp.net MVC应用程序中使用memorycache每次都会创建它

ASP.NET Core中的高级依赖项注入

ASP.NET Core中的MachineKey.Protect()等效项

ASP.NET Core中的HttpRuntime.AppDomainAppPath等效项

ASP.NET Core Worker Service中的依赖项注入

如何在IHttpcontextAccessor的ASP.NET Core 2.0中使用依赖项注入

使用 Entity Framework Core 更新 ASP.NET Core 中相同字段的并行请求

ASP.NET Core - 使用 EF Core 更新 IMemoryCache 中缓存 List<Element> 的 1 元素

如何在C#Core Console应用中使用MemoryCache?

代码中的ASP.NET Core appsettings.json更新

更新ASP.NET One Core中的Claims值

在ASP.NET Core中插入/更新记录时出错

在ASP.NET Core 2.0中更新身份

ASP.NET Core 中的 TagHelper 不更新值

从ASP.NET CORE中的子表更新父表

在 asp.net core 中更新的最佳方式是什么

无法更新 asp.net core 2.2 中的会话数据

无法使用ASP .NET Core更新SQL位列

ASP.NET Core中的属性

ASP.NET Core中的HttpHead

在ASP.NET Core中模拟IPrincipal