TCIS.Caching.InMemory
1.0.0-rc.11
dotnet add package TCIS.Caching.InMemory --version 1.0.0-rc.11
NuGet\Install-Package TCIS.Caching.InMemory -Version 1.0.0-rc.11
<PackageReference Include="TCIS.Caching.InMemory" Version="1.0.0-rc.11" />
<PackageVersion Include="TCIS.Caching.InMemory" Version="1.0.0-rc.11" />
<PackageReference Include="TCIS.Caching.InMemory" />
paket add TCIS.Caching.InMemory --version 1.0.0-rc.11
#r "nuget: TCIS.Caching.InMemory, 1.0.0-rc.11"
#:package TCIS.Caching.InMemory@1.0.0-rc.11
#addin nuget:?package=TCIS.Caching.InMemory&version=1.0.0-rc.11&prerelease
#tool nuget:?package=TCIS.Caching.InMemory&version=1.0.0-rc.11&prerelease
TCIS.Caching.InMemory
Provides a high-performance In-Memory caching solution for the TCIS ecosystem, implementing the interfaces from TCIS.Caching.
Ideal for single-instance applications or when data does not need to be shared across multiple nodes.
📦 Installation
Add the package to your project:
dotnet add package TCIS.Caching.InMemory
⚙️ Configuration (appsettings.json)
Add the InMemoryConfigs configuration block to your appsettings.json file:
{
"InMemoryConfigs": {
"Enabled": true,
"KeyPrefix": "tcis",
"HideErrors": true,
"CacheEmptyCollections": false,
"DefaultAbsoluteExpirationMinutes": 20,
"SizeLimit": 1024
}
}
🚀 Registration / Setup (Dependency Injection)
In the Program.cs file, use the AddTInMemoryCache extension method:
// Automatically reads configuration from IConfiguration (looks for "InMemoryConfigs" by default)
builder.Services.AddTInMemoryCache(builder.Configuration);
// Or configure via code (Action)
builder.Services.AddTInMemoryCache(options =>
{
options.Enabled = true;
options.KeyPrefix = "my_app";
options.DefaultAbsoluteExpirationMinutes = 30;
});
💡 Usage
public class UserService
{
private readonly ICacheService _cacheService;
public UserService(ICacheService cacheService)
{
_cacheService = cacheService;
}
public async Task<User> GetUserAsync(int userId)
{
string cacheKey = $"user:{userId}";
// Retrieve from cache, or execute the factory function if not found
return await _cacheService.GetOrSetAsync(
cacheKey,
async () => await LoadUserFromDbAsync(userId),
TimeSpan.FromMinutes(10));
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net8.0
- Microsoft.Extensions.Caching.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Caching.Memory (>= 8.0.1)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Options (>= 9.0.0)
- TCIS.Caching (>= 1.0.0-rc.11)
- TCIS.Core (>= 1.0.0-rc.11)
- TCIS.Logging.Abstractions (>= 1.0.0-rc.11)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on TCIS.Caching.InMemory:
| Package | Downloads |
|---|---|
|
TCIS.Caching.Hybrid
TCIS Core Framework is an application framework for building modular, multi-tenant applications on ASP.NET Core. Hybrid caching (L1/L2) implementation for TCIS Framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-rc.11 | 40 | 7/28/2026 |
| 1.0.0-rc.10 | 53 | 7/24/2026 |
| 1.0.0-rc.9 | 51 | 7/21/2026 |
| 1.0.0-rc.8 | 51 | 7/21/2026 |
| 1.0.0-rc.7 | 51 | 7/17/2026 |
| 1.0.0-rc.6 | 64 | 7/7/2026 |
| 1.0.0-rc.5 | 65 | 7/7/2026 |
| 1.0.0-rc.4 | 70 | 6/24/2026 |
| 1.0.0-rc.2 | 76 | 5/12/2026 |
| 1.0.0-rc.1 | 75 | 5/12/2026 |