Liwendong.CacheExtend 1.6.0

dotnet add package Liwendong.CacheExtend --version 1.6.0
                    
NuGet\Install-Package Liwendong.CacheExtend -Version 1.6.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Liwendong.CacheExtend" Version="1.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Liwendong.CacheExtend" Version="1.6.0" />
                    
Directory.Packages.props
<PackageReference Include="Liwendong.CacheExtend" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Liwendong.CacheExtend --version 1.6.0
                    
#r "nuget: Liwendong.CacheExtend, 1.6.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Liwendong.CacheExtend@1.6.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Liwendong.CacheExtend&version=1.6.0
                    
Install as a Cake Addin
#tool nuget:?package=Liwendong.CacheExtend&version=1.6.0
                    
Install as a Cake Tool

Liwendong.CacheExtend

缓存相关管理。

统一缓存抽象(内存/Redis)、缓存帮助类与防穿透占位等能力。

安装

dotnet add package Liwendong.CacheExtend

说明

  • 本包属于 LiwendongPackages 组件集合。
  • 具体目标框架与依赖请参阅本包 .csproj 文件。

版本历史

1.6.0 (2026-11-24)

  • 新增:ICacheHelper.TryGet<T>(key, out value),用返回值区分"命中"与"未命中"。ICacheHelperExtensions.Get<T>(key, cacheTime, acquire) 的命中判定改用 TryGet,修复缓存中合法的 0/false/DateTime.MinValue 等默认值被当成未命中、导致反复回源的问题(缓存穿透占位逻辑对值类型 falsy 值失效)。
  • 修复:MemoryCacheHelper.RemoveAll() / RemoveByPattern() 在 .NET Core(netcoreapp3.1 / net8.0)下因反射取不到 Keys 属性而静默失效的问题,改为自行维护键名跟踪集合(并惰性清理过期键),使模式删除/全量删除在两个框架下均生效。
  • 修复:MemoryCacheHelper.Set(key, value, TimeSpan, bool) 传入 TimeSpan.Zero 或负数时在 .NET Core 抛出 ArgumentOutOfRangeException、而 .NET Framework 不抛的跨框架行为差异;该重载现委托给 4 参数重载,统一 Zero=不启用过期、负数抛异常 的语义。
  • 优化:Remove 跳过数组中的 null 键,避免整批删除因单个 null 中断。
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
.NET Framework net451 is compatible.  net452 was computed.  net46 is compatible.  net461 was computed.  net462 was computed.  net463 was computed.  net47 is compatible.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on Liwendong.CacheExtend:

Package Downloads
Liwendong.Frameworks

基础框架

Liwendong.CacheExtend.CSRedis

CSRedis缓存管理

Liwendong.Wexin.MP.SDK

微信公众号辅助SDK

Liwendong.JwtAuthorize

JWT辅助文件

Liwendong.CacheExtend.StackExchangeRedis

StackExchange.Redis缓存管理

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.6.0 188 11/24/2026
1.5.0 740 10/20/2026
1.3.0 700 9/23/2025
1.2.0 1,721 7/29/2025
1.1.0 6,971 7/18/2022
1.0.2 8,882 9/10/2021
1.0.1 540 7/20/2021
1.0.0 2,498 6/18/2021