Tamkeen.CacheService.Core 1.0.4.1

dotnet add package Tamkeen.CacheService.Core --version 1.0.4.1
                    
NuGet\Install-Package Tamkeen.CacheService.Core -Version 1.0.4.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="Tamkeen.CacheService.Core" Version="1.0.4.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Tamkeen.CacheService.Core" Version="1.0.4.1" />
                    
Directory.Packages.props
<PackageReference Include="Tamkeen.CacheService.Core" />
                    
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 Tamkeen.CacheService.Core --version 1.0.4.1
                    
#r "nuget: Tamkeen.CacheService.Core, 1.0.4.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 Tamkeen.CacheService.Core@1.0.4.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=Tamkeen.CacheService.Core&version=1.0.4.1
                    
Install as a Cake Addin
#tool nuget:?package=Tamkeen.CacheService.Core&version=1.0.4.1
                    
Install as a Cake Tool

Tamkeen CacheService

Overview

Tamkeen CacheService is a .NET library for interacting with Redis, providing easy-to-use interfaces and classes for caching, locking, and database operations. The library is compatible with both .NET Core 8 and .NET Framework 4.7.

Features

  • Easy-to-use interfaces for cache operations
  • Support for synchronous and asynchronous operations
  • Redis connection management
  • Key expiry and locking mechanisms

Getting Started

Prerequisites

  • .NET Core 8.0 or .NET Framework 4.7
  • Redis server (local or remote)

Installation

To include Tamkeen CacheService in your project, run the following command:

Install-Package Tamkeen.RateLimiter.Core -Version 1.0.0

Configuration

Define the Redis connection configuration using the CacheConfig class:

var config = new CacheConfig
{
    ClientName = "ExampleClient",
    DefaultDatabase = 0,
    AllowAdmin = true,
    AbortOnConnectFail = false,
    ConnectTimeout = 2000,
    SyncTimeout = 1000,
    EndPoint = "127.0.0.1:6379",  // Replace with your Redis server endpoint
    Password = "yourpassword"     // Replace with your Redis server password if needed
};

Creating a Redis Connection Factory

Create an instance of RedisConnectionFactory:

IRedisConnectionFactory factory = new RedisConnectionFactory(config);

Using the Connection

Get the ConnectionMultiplexer and perform cache operations:

var connection = factory.Connection();

if (connection.IsConnected)
{
    var db = factory.GetDatabase();
    db.StringSet("exampleKey", "exampleValue");
    string value = db.StringGet("exampleKey");
    Console.WriteLine($"Value for 'exampleKey': {value}");
}
else
{
    Console.WriteLine("Failed to connect to Redis.");
}

Cache Provider

Use the RedisCacheProvider for higher-level cache operations:

ICacheProvider cacheProvider = new RedisCacheProvider(factory);

cacheProvider.SetValue("exampleKey", "exampleValue", TimeSpan.FromMinutes(5));
string value = cacheProvider.GetValue<string>("exampleKey");
Console.WriteLine($"Cached value: {value}");

cacheProvider.DeleteValue("exampleKey");

Project Structure

Tamkeen.CacheService.Core
├── Classes
│   ├── CacheConfig.cs
│   ├── ConnectionMultiplexerWrapper.cs
│   ├── RedisCacheProvider.cs
│   ├── RedisConnectionFactory.cs
├── Interfaces
│   ├── ICacheProvider.cs
│   ├── IConnectionMultiplexerWrapper.cs
│   ├── IRedisConnectionFactory.cs

Running the Tests

To run the tests, use the following command:

dotnet test

This will execute the unit tests against both .NET Core 8 and .NET Framework 4.7.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your changes.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Documentation

  • Project summary: docs/PROJECT_SUMMARY.md
  • Architecture: docs/ARCHITECTURE.md
  • Configuration: docs/CONFIGURATION.md
  • Operations (build/run/test/coverage): docs/OPERATIONS.md
  • Contributing: docs/CONTRIBUTING.md
  • Code Style: docs/CODE_STYLE.md
  • Security: docs/SECURITY.md

Contact

For questions or feedback, please contact support@tamkeen.com.ye.

Product Compatible and additional computed target framework versions.
.NET 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 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. 
.NET Framework net47 is compatible.  net471 was computed.  net472 was computed.  net48 was computed.  net481 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.0.4.1 268 9/22/2025
1.0.4 204 9/20/2025