Skip to content

Instantly share code, notes, and snippets.

@cosminpopescu14
Created September 30, 2019 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cosminpopescu14/f08b027871d71226e42e0c8735b83436 to your computer and use it in GitHub Desktop.
Save cosminpopescu14/f08b027871d71226e42e0c8735b83436 to your computer and use it in GitHub Desktop.
using System;
using StackExchange.Redis;
namespace RedisDemoApp
{
class Program
{
static void Main(string[] args)
{
ConnectionMultiplexer connectionMultiplexer = ConnectionMultiplexer
.Connect("localhost:6379"); //redis is in docker. see with docker ps
var redis = connectionMultiplexer.GetDatabase();
redis.StringSet("key", "redis from docker");
Console.WriteLine(redis.StringGet("name")); //key in redis
Console.WriteLine(redis.StringGet("key"));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment