Skip to content

A basic typed wrapper over Redis to store and search objects using ServiceStack.Redis

Notifications You must be signed in to change notification settings

russdaygh/RedisStoreWrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RedisStoreWrapper

A basic typed wrapper over Redis to store and search objects using ServiceStack.Redis

Basic Usage

Setup

var objects =
    Enumerable.Range(0, 100)
        .Select(i => new MyType {Id = i, Name = $"Object {i}", Comment = $"Comment {i}"})
        .ToList();

var builder = new RedisStoreBuilder<MyType>(
        primarySearchTerm: new SearchTerm<MyType>("Id", o => o.Id.ToString()),
        new RedisEndpoint("hostname", 6380,
            "password")
        {
            Ssl = true
        })
    .AddSearchTerm(new SearchTerm<MyType>("Name", o => o.Name))
    .AddData(objects);

var store = builder.Build();

Find Items By Primary Key

var object1 = store.Find(1);

Search By Term

var object5 = store.Search("Name", "Object 5");

About

A basic typed wrapper over Redis to store and search objects using ServiceStack.Redis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages