QuickRedis 1.0.6
dotnet add package QuickRedis --version 1.0.6
NuGet\Install-Package QuickRedis -Version 1.0.6
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="QuickRedis" Version="1.0.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add QuickRedis --version 1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: QuickRedis, 1.0.6"
#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 QuickRedis as a Cake Addin #addin nuget:?package=QuickRedis&version=1.0.6 // Install QuickRedis as a Cake Tool #tool nuget:?package=QuickRedis&version=1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
QuickRedis
QuickRedis is a library that help you implement Redis quickly with useful methods.
How to use
Install QuickRedis
from Nuget
dotnet add package QuickRedis
nuget install QuickRedis
builder.Services.AddQuickRedis(options => {
options.Configuration = "localhost";
options.InstanceName = "main_";
});
private readonly IQuickRedisService _quickRedisService;
public TestController(IQuickRedisService quickRedisService)
{
_quickRedisService = quickRedisService;
}
Run redis from docker
# w/ gui
docker run -d --name redis_stack --restart unless-stopped -p 6379:6379 -p 8001:8001 -v redis_data:/data redis/redis-stack:latest
# w/o gui
docker run -d --name redis_stack_server --restart unless-stopped -p 6379:6379 -v redis_data:/data redis/redis-stack-server:latest
Methods
// GetAsync
var product = await _quickRedisService.GetAsync<Product>("unique_product_id");
var product = _quickRedisService.GetAsync<Product>("unique_product_id").Result;
// SetAsync
await _quickRedisService.SetAsync("unique_product_id", product);
_quickRedisService.SetAsync("unique_product_id", product).Wait();
// RemoveAsync
await _quickRedisService.RemoveAsync("unique_product_id");
_quickRedisService.RemoveAsync("unique_product_id").Wait();
// AddOrGetFuncAsync
List<string> TestMethod();
var methodResult = await _quickRedisService.AddOrGetFuncAsync<List<string>>("result_unique_key", () => TestMethod());
var methodResult = _quickRedisService.AddOrGetFuncAsync<List<string>>("result_unique_key", () => TestMethod()).Result;
Samples
Product | Versions 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net7.0
-
net8.0
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release