AvvaMobile.Core.RedisClient
1.0.7
See the version list below for details.
dotnet add package AvvaMobile.Core.RedisClient --version 1.0.7
NuGet\Install-Package AvvaMobile.Core.RedisClient -Version 1.0.7
<PackageReference Include="AvvaMobile.Core.RedisClient" Version="1.0.7" />
paket add AvvaMobile.Core.RedisClient --version 1.0.7
#r "nuget: AvvaMobile.Core.RedisClient, 1.0.7"
// Install AvvaMobile.Core.RedisClient as a Cake Addin #addin nuget:?package=AvvaMobile.Core.RedisClient&version=1.0.7 // Install AvvaMobile.Core.RedisClient as a Cake Tool #tool nuget:?package=AvvaMobile.Core.RedisClient&version=1.0.7
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);
Serialized Set
var key = "foo";
var value = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
var result = await _redis.Serialize_Set(key, value);
Deserialized Get
var key = "foo";
var valueList = await _redis.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 | 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 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. |
-
net7.0
- Microsoft.AspNetCore (>= 2.2.0)
- Microsoft.AspNetCore.Mvc (>= 2.2.0)
- StackExchange.Redis (>= 2.6.104)
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.