Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement