SHARE
TWEET

Untitled

a guest Oct 18th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. using StackExchange.Redis;
  4.  
  5. namespace RedisDemoApp
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             ConnectionMultiplexer connectionMultiplexer = ConnectionMultiplexer
  12.                 .Connect("localhost:6379"); //redis is in docker. see with docker ps
  13.             var redis = connectionMultiplexer.GetDatabase();
  14.             redis.StringSet("key", "redis from docker");
  15.             Console.WriteLine(redis.StringGet("name")); //key in redis
  16.             Console.WriteLine(redis.StringGet("key"));
  17.         }
  18.     }
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top