AvvaMobile.Core.RedisClient 1.0.16

dotnet add package AvvaMobile.Core.RedisClient --version 1.0.16
NuGet\Install-Package AvvaMobile.Core.RedisClient -Version 1.0.16
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="AvvaMobile.Core.RedisClient" Version="1.0.16" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AvvaMobile.Core.RedisClient --version 1.0.16
#r "nuget: AvvaMobile.Core.RedisClient, 1.0.16"
#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 AvvaMobile.Core.RedisClient as a Cake Addin
#addin nuget:?package=AvvaMobile.Core.RedisClient&version=1.0.16

// Install AvvaMobile.Core.RedisClient as a Cake Tool
#tool nuget:?package=AvvaMobile.Core.RedisClient&version=1.0.16

AvvaMobile.Core.Redis.RedisClient

Join Our Open Source Team

If you love at least two of the followings, you are welcome to join our open source team, please contact us at opensource@avvamobile.com.

  • Pizza 🍕 or Hamburger 🍔
  • Beer 🍺 or Whiskey 🥃
  • Video Games 🎮
  • Car Racing 🏎️
  • Electronic Music 🎛️ or Rock Music 🎸

Developers

NuGet Package

To use NuGet package, please go to https://www.nuget.org/packages/AvvaMobile.Core.RedisClient

Namespace

All necessary classes are in the namespace below.

using AvvaMobile.Core.Redis;

Dependency Injection

Client interface is IRedisClient and implementation is RedisClient.

Register the client in the program.cs file.

builder.Services.AddSingleton<IRedisClient, RedisClient>(r => new RedisClient(host: "localhost", port: 6379, user: "default", password: "redispw"));

Then initiliaze the instance in the constructor of the class.

namespace AvvaMobile.Core.Redis.Samples;

public class Samples
{
    private readonly IRedisClient _redis;
    
    public Samples(IRedisClient redis)
    {
        _redis = redis;
    }
}

Samples

Check Key Is Exists

var key = "foo";
    
var isExists = await _redis.IsExists(key);

if (isExists)
{
    Console.Write("Key is exists.");
}
else
{
    Console.Write("Key is NOT exists.");
}

Set Value

var key = "foo";
var valueString = "bar";

var resultString = await _redis.Set(key, valueString);

Get String

var key = "foo";

var stringValue = await _redis.Get_String(key);

Set Serialized

var key = "foo";
var value = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };

var result = await _redis.Set_Serialized(key, value);

Get Deserialized

var key = "foo";

var valueList = await _redis.Get_Deserialized<List<int>>(key);

Set Select List Items (for Web)

var key = "foo";
var value = new List<SelectListItem>
{
    new SelectListItem{Text = "Item 1", Value = "1"},
    new SelectListItem{Text = "Item 2", Value = "2"},
    new SelectListItem{Text = "Item 3", Value = "3"},
    new SelectListItem{Text = "Item 4", Value = "4"}
};

var result = await _redis.Set_SelectListItems(key, value);

Get Select List Items (for Web)

var key = "foo";

var valueList = await _redis.Get_SelectListItems(key);

Remove a Key

var key = "foo";

await _redis.Remove(key);

Clear Database

await _redis.ClearAll();
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 (1)

Showing the top 1 NuGet packages that depend on AvvaMobile.Core.RedisClient:

Package Downloads
AvvaMobile.Core

This package is build for Avva Mobile developers to make their solutions easy to develop.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.16 317 1/3/2024
1.0.15 214 12/20/2023
1.0.14 519 5/31/2023
1.0.13 363 5/12/2023
1.0.12 353 5/12/2023
1.0.11 388 5/12/2023
1.0.10 290 5/4/2023
1.0.9 163 12/20/2023
1.0.8 175 12/20/2023
1.0.7 348 5/3/2023
1.0.5 364 5/2/2023