Common.Cache.MemoryCache 1.3.1

dotnet add package Common.Cache.MemoryCache --version 1.3.1
                    
NuGet\Install-Package Common.Cache.MemoryCache -Version 1.3.1
                    
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.1" />
                    
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.1" />
                    
Directory.Packages.props
<PackageReference Include="Common.Cache.MemoryCache" />
                    
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 Common.Cache.MemoryCache --version 1.3.1
                    
#r "nuget: Common.Cache.MemoryCache, 1.3.1"
                    
#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.1
                    
#: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.1
                    
Install as a Cake Addin
#tool nuget:?package=Common.Cache.MemoryCache&version=1.3.1
                    
Install as a Cake Tool

Common.Cache.MemoryCache

操作例子

首先需要安装组件,建议直接安装最新版本,然后就需要注入服务

services.AddMemoryCacheExtension(x =>
{
    x.DefaultExpiry = TimeSpan.FromSeconds(5); // 默认缓存过期时间
});

然后就可以在需要使用的地方直接注入ICacheProvider进行使用

版本更新记录

  • 1.3.1
    • 更新批量删除缓存的日志输出
  • 1.3.0
    • 修复.Net8模糊匹配生效问题
    • 引用.Net10正式包
  • 1.3.0-beta9
    • 更新.Net10
  • 1.3.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 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 is compatible.  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.

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.1 72 12/10/2025
1.3.0 327 11/30/2025
1.3.0-beta9 139 11/6/2025
1.3.0-beta8 177 10/9/2025
1.3.0-beta7 218 8/28/2025
1.3.0-beta5 178 7/14/2025
1.3.0-beta4 388 6/5/2024
1.3.0-beta3 154 2/9/2024
1.3.0-beta2 139 2/8/2024
1.3.0-beta11 257 11/12/2025
1.3.0-beta10 87 11/7/2025
1.3.0-beta1 270 11/14/2022
1.2.0 532 11/12/2022
1.1.1 599 7/9/2022
1.1.0 693 11/11/2020
1.0.1 591 10/9/2020
1.0.0 608 10/8/2020