Created
September 30, 2019 04:38
-
-
Save cosminpopescu14/f08b027871d71226e42e0c8735b83436 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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