Not abel to get the list of items using NoSql distributed cache Database- Redis
Hai Guys,Please let me know if anyone has worked with the NoSql distributed cache database-Redis
I am trying to do something using the console application. By now I am able to create the Server as well as client and also can connect the server to client. But not able to retrieve the database content like the collections and all.
I want to get the list of the records which are in the database and then I can use the Linq or Lambda expression to filter and query the records.
As I am trying with the Visual Studio and new to this, so getting the issue. I tried to learn from other websites and links but still didn't get the proper solution as most of the places, I can see peoples are just setting the records and then getting them from the cache. But in my case, I already have the database and I need to filter the records from the database.
I am using the below code snippet after installing all the necessary references:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ServiceStack.Redis;
using ServiceStack.Redis.Generic;
namespace RedisDemoApp
{
class Program
{
static void Main(string[] args)
{
using (var redisClient = new RedisClient("127.0.0.1", 6391))
{
IRedisTypedClient<Hotel> redis = redisClient.As<Hotel>();
IRedisList<Hotel> mostSelling = redis.Lists["urn:hotel_ids"];// not working
.......
}
}
}
}
Please let me know if anyone has any idea regarding this. It will be great help for me.
Thanks in advance.