Skip to content

Latest commit

 

History

History
69 lines (58 loc) · 1.73 KB

README.md

File metadata and controls

69 lines (58 loc) · 1.73 KB

Overview

The purpose of this library is to store cache data, the infrastructure "StackExchange.Redis" is fed, but this library offers more generic and clean architecture. This library was developed .NET Standard.

Covarage

  • StringSet
  • SortedSet
  • Set

Installation

Nuget Package

Package Manager

Install-Package TStack.RedisExchange -Version 1.0.3

.NET CLI

dotnet add package TStack.RedisExchange --version 1.0.3

PackageReference

<PackageReference Include="TStack.RedisExchange" Version="1.0.3" />

Paket CLI

paket add TStack.RedisExchange --version 1.0.3

Usage

This library supports cluster mode, for usage follow steps.

Step One

Define Redis Context Config

public class RedisContext : RedisContextConfig
{
    public RedisContext() : base(new List<RedisServer> { new RedisServer("localhost", 6379)}, "", "ClientName", 15000, 15000)
    {

    }
}

Step Two

Define Provider

public class ProjectProvider : RedisProvider<RedisContext>
{

}

Ready to use.

Fundamentals

All redis functions need a key parameter for keep data, so you can access with this data from cache from key parameter.

An example for StringSet

ProjectProvider _provider = new ProjectProvider();
Person person = new Person("ferhat","candas");
var expire = new TimeSpan(0, 0, 5);
provider.Add("stringsetkey", person, expire);

For more example, than look tests

Author

Ferhat Candaş - Software Developer