A basic typed wrapper over Redis to store and search objects using ServiceStack.Redis
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();
var object1 = store.Find(1);
var object5 = store.Search("Name", "Object 5");