Hello World ! Program in Redis.

In this article we will demonstrate the hello word program with the help of console application.

** We need to include the StackExchange.Redis reference to communicate to Redis Cache.

Program.cs

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using StackExchange.Redis;

namespace Redis_Demo

{

    public class Program

    {

        static void Main(string[] args)

        {

            ConnectionMultiplexer redisconnection = ConnectionMultiplexer.Connect("localhost");

            IDatabase dbredis = redisconnection.GetDatabase();

            dbredis.StringSet("Key1","Hello World!");

            Console.WriteLine(dbredis.StringGet("Key1"));

            Console.ReadLine();

        }

    }

}

helloworldprog

Leave a Reply

Your email address will not be published. Required fields are marked *