TCIS.Caching.InMemory 1.0.0-rc.9

This is a prerelease version of TCIS.Caching.InMemory.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package TCIS.Caching.InMemory --version 1.0.0-rc.9
                    
NuGet\Install-Package TCIS.Caching.InMemory -Version 1.0.0-rc.9
                    
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="TCIS.Caching.InMemory" Version="1.0.0-rc.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TCIS.Caching.InMemory" Version="1.0.0-rc.9" />
                    
Directory.Packages.props
<PackageReference Include="TCIS.Caching.InMemory" />
                    
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 TCIS.Caching.InMemory --version 1.0.0-rc.9
                    
#r "nuget: TCIS.Caching.InMemory, 1.0.0-rc.9"
                    
#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 TCIS.Caching.InMemory@1.0.0-rc.9
                    
#: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=TCIS.Caching.InMemory&version=1.0.0-rc.9&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=TCIS.Caching.InMemory&version=1.0.0-rc.9&prerelease
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 54 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