I have used StackExchange.Redis for c# redis cache.
cache.StringSet("Key1", CustomerObject);
but I want to store data like
cache.StringSet("Key1", ListOfCustomer);
so that one key has all Customer List stored and it is easy to
search,group,filter customer Data also inside that List
Answers are welcome using ServiceStack.Redis or StackExchange.Redis
解决方案
You can use ServiceStack.Redis high-level IRedisTypedClient Typed API for managing rich POCO Types.
First get a typed Redis client for Customers with:
var redisCustomers = redis.As();
Which will resolve a high-level typed API for managing Customer POCO's that then lets you persist a single Customer with:
redisCustomers.SetEntry("Customer1", CustomerObject);
Or a list of Customers with:
redisCustomers.Lists["Customers"].AddRange(ListOfCustomer);