CM.RedisCache 1.0.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package CM.RedisCache --version 1.0.5
NuGet\Install-Package CM.RedisCache -Version 1.0.5
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="CM.RedisCache" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CM.RedisCache --version 1.0.5
#r "nuget: CM.RedisCache, 1.0.5"
#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.
// Install CM.RedisCache as a Cake Addin
#addin nuget:?package=CM.RedisCache&version=1.0.5

// Install CM.RedisCache as a Cake Tool
#tool nuget:?package=CM.RedisCache&version=1.0.5

CM.RedisCache for .NET

Project Description

CM.RedisCache is a simple cache library that uses Redis as database, implemented as an extension method over IQueryable interface.

Download & Install

Nuget Package CM.RedisCache

Install-Package CM.RedisCache

Minimum Requirements: .NET Standard 2.0

Usage

C# Example for ASP Net Web API - Configuration

public void ConfigureServices(IServiceCollection services)
{
	// Add RedisCache singleton service
	services.AddRedisCacheService(Configuration.GetValue<string>("RedisConnection"));
	...
}

...

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
	... 

	// Initialize Redis Multiplexer
	app.UseRedisCache();
}

C# Example for ASP Net Web API - Usage

[Route("travels")]
[HttpGet]
public async Task<IActionResult> GetTravels()
{
	var nations = new String[]
	{
	 "Italy", "France", "Japan"
	};

	// Query definition
	var query = DbContex.Travel.Where(i => i.Enabled == true && nations.Contains(i.Nation));

	// Unique query key generated on IQueryable object (used as redis key), only for debug
	var key = query.GetCacheKey();	
	
	// Cache result for 24 hours automatically in redis
	var result = await query.GetFromCacheAsync(24);		// pass an int or specific TimeSpan
	return Ok(result);
}
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. 
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.6 84 4/17/2024
1.0.5 74 4/10/2024
1.0.4 84 4/9/2024
1.0.3 86 4/4/2024
1.0.2 82 4/3/2024
1.0.1 76 4/3/2024
1.0.0 78 4/3/2024