Zhomfr.Cache.InMemory
0.7.0
dotnet add package Zhomfr.Cache.InMemory --version 0.7.0
NuGet\Install-Package Zhomfr.Cache.InMemory -Version 0.7.0
<PackageReference Include="Zhomfr.Cache.InMemory" Version="0.7.0" />
<PackageVersion Include="Zhomfr.Cache.InMemory" Version="0.7.0" />
<PackageReference Include="Zhomfr.Cache.InMemory" />
paket add Zhomfr.Cache.InMemory --version 0.7.0
#r "nuget: Zhomfr.Cache.InMemory, 0.7.0"
#:package Zhomfr.Cache.InMemory@0.7.0
#addin nuget:?package=Zhomfr.Cache.InMemory&version=0.7.0
#tool nuget:?package=Zhomfr.Cache.InMemory&version=0.7.0
InMemory Driver for Zhomfr.Cache.Abstractions.
⚠️ Warning: Active Development (< 1.0.0)
Prior to the release of stable version
1.0.0, this library follows SemVer for initial development. This means breaking changes may occur even in minor releases (0.x).We strongly recommend pinning the package version in your
.csprojto avoid unexpected build errors.
This library provides an InMemory implementation of the Zhomfr.Cache.Abstractions cache contract.
📦 Installation
Install package:
dotnet add package Zhomfr.Cache.InMemory
After register service in DI:
using Zhomfr.Cache.Abstractions;
builder.Services.AddMemoryCache();
builder.Services.AddDefaultCache<InMemoryCache, InMemoryConfig>();
builder.Services.AddKeyedCache<InMemoryCache, InMemoryConfig>("AwesomeKey");
Configuration Convention
All settings are located in appsettings.json under the Zhomfr:Cache section:
- The default service uses the
Zhomfr:Cache:Defaultsubsection. - Keyed services use subsections where the name matches the service key, resulting in
Zhomfr:Cache:KeyName.
Your appsettings.json file should follow this structure:
{
"Zhomfr": {
"Cache": {
"Default": {
"Prefix": "somePrefixForDefault",
"Ttl": 10
},
"AwesomeKey": {
"Prefix": "somePrefixForAwesomeKey",
"Ttl": 60
}
}
}
}
And use in your own code:
using Zhomfr.Cache.Abstractions;
public class MyAwesomeClass(ICache cache){}
public class MyAwesomeClass([FromKeyedServices("AwesomeKey")]ICache cache){}
For more details, see the documentation for Nuget or GitHub.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Microsoft.Extensions.Caching.Memory (>= 10.0.14)
- Zhomfr.Cache.Abstractions (>= 0.7.0)
- Zhomfr.Validation.Rules (>= 0.7.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 |
|---|---|---|
| 0.7.0 | 49 | 10/26/2026 |