Common.Cache.MemoryCache
1.3.0-beta8
This is a prerelease version of Common.Cache.MemoryCache.
There is a newer prerelease version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Common.Cache.MemoryCache --version 1.3.0-beta8
NuGet\Install-Package Common.Cache.MemoryCache -Version 1.3.0-beta8
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="Common.Cache.MemoryCache" Version="1.3.0-beta8" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Common.Cache.MemoryCache" Version="1.3.0-beta8" />
<PackageReference Include="Common.Cache.MemoryCache" />
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 Common.Cache.MemoryCache --version 1.3.0-beta8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Common.Cache.MemoryCache, 1.3.0-beta8"
#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 Common.Cache.MemoryCache@1.3.0-beta8
#: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=Common.Cache.MemoryCache&version=1.3.0-beta8&prerelease
#tool nuget:?package=Common.Cache.MemoryCache&version=1.3.0-beta8&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Common.Cache.MemoryCache
操作例子
首先需要安装组件,建议直接安装最新版本,然后就需要注入服务
services.AddMemoryCacheExtension(x =>
{
x.DefaultExpiry = TimeSpan.FromSeconds(5); // 默认缓存过期时间
});
然后就可以在需要使用的地方直接注入ICacheProvider进行使用
版本更新记录
- 1.2.0-beta8
- 设置不缓存空值的时候问题修复
- 1.3.0-beta7
- 修复GetOrCreateAsync读取不到缓存还存储的问题
- 1.3.0-beta6
- 更新命名空间
- 1.3.0-beta5
- 支持.Net9
- 移除对netstandard2.1的支持
- 更新注入方法AddMemoryCacheStore
- 1.3.0-beta4
- 修改方法KeyDeleteInBatchAsync为RemoveMatchKeyAsync
- 修改方法GetAllCacheKeys为GetAllKeys
- 修改方法RemoveCacheAllAsync改为RemoveAllKeyAsync
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. 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 is compatible. 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 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Azrng.Cache.Core (>= 0.0.3)
- Microsoft.Extensions.Caching.Memory (>= 6.0.1)
- Microsoft.Extensions.DependencyInjection (>= 6.0.0)
-
net7.0
- Azrng.Cache.Core (>= 0.0.3)
- Microsoft.Extensions.Caching.Memory (>= 7.0.0)
- Microsoft.Extensions.DependencyInjection (>= 7.0.0)
-
net8.0
- Azrng.Cache.Core (>= 0.0.3)
- Microsoft.Extensions.Caching.Memory (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
-
net9.0
- Azrng.Cache.Core (>= 0.0.3)
- Microsoft.Extensions.Caching.Memory (>= 9.0.0)
- Microsoft.Extensions.DependencyInjection (>= 9.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.3.0-beta9 | 19 | 11/6/2025 |
| 1.3.0-beta8 | 170 | 10/9/2025 |
| 1.3.0-beta7 | 214 | 8/28/2025 |
| 1.3.0-beta5 | 174 | 7/14/2025 |
| 1.3.0-beta4 | 386 | 6/5/2024 |
| 1.3.0-beta3 | 152 | 2/9/2024 |
| 1.3.0-beta2 | 138 | 2/8/2024 |
| 1.3.0-beta1 | 263 | 11/14/2022 |
| 1.2.0 | 523 | 11/12/2022 |
| 1.1.1 | 592 | 7/9/2022 |
| 1.1.0 | 677 | 11/11/2020 |
| 1.0.1 | 578 | 10/9/2020 |
| 1.0.0 | 595 | 10/8/2020 |