AvvaMobile.Core.RedisClient 1.0.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package AvvaMobile.Core.RedisClient --version 1.0.5                
NuGet\Install-Package AvvaMobile.Core.RedisClient -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="AvvaMobile.Core.RedisClient" Version="1.0.5" />                
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.5                
#r "nuget: AvvaMobile.Core.RedisClient, 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 AvvaMobile.Core.RedisClient as a Cake Addin
#addin nuget:?package=AvvaMobile.Core.RedisClient&version=1.0.5

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

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 String

var key = "foo";
var value = "bar";

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

Get String

var key = "foo";

var stringValue = await _redis.String_Get(key);

Set Int

var key = "Turkiye";
var countryCode = 90;

var result = await _redis.Int_Set(key, countryCode);

Get Int

var key = "Turkiye";

var countryCode = await _redis.Int_Get(key);

Set List (Serialized)

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

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

Get List (Deserialized)

var key = "foo";

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

Set List of Select List Items (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.List_SelectListItem_Set(key, value);

Get List of Select List Items (Web)

var key = "foo";

var valueList = await _redis.List_SelectListItem_Get(key);
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 was computed.  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 390 1/3/2024
1.0.15 241 12/20/2023
1.0.14 642 5/31/2023
1.0.13 408 5/12/2023
1.0.12 387 5/12/2023
1.0.11 425 5/12/2023
1.0.10 315 5/4/2023
1.0.9 193 12/20/2023
1.0.8 207 12/20/2023
1.0.7 376 5/3/2023
1.0.5 388 5/2/2023