Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用StackExchange.Redis向Redis添加和检索数据集_C#_Redis_Stackexchange.redis - Fatal编程技术网

C# 使用StackExchange.Redis向Redis添加和检索数据集

C# 使用StackExchange.Redis向Redis添加和检索数据集,c#,redis,stackexchange.redis,C#,Redis,Stackexchange.redis,我是Redis的新手。我能够使用此命令将数据存储和检索到redis hmset user:user1 12 13 14 15 而且我还可以通过以下方式检索数据: hgetall user:user1 我想在我的c#程序上使用stackExchange.redis做同样的事情。 在c#?中如何执行此操作要在哈希中设置多个值,可以调用以下哈希集方法重载: ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("localhost

我是Redis的新手。我能够使用此命令将数据存储和检索到redis

hmset user:user1 12 13 14 15 
而且我还可以通过以下方式检索数据:

hgetall user:user1
我想在我的c#程序上使用stackExchange.redis做同样的事情。
在c#?

中如何执行此操作要在哈希中设置多个值,可以调用以下哈希集方法重载:

ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("localhost");
IDatabase db = redis.GetDatabase();
db.HashSet("user:user1", new HashEntry[] { new HashEntry("12", "13"), new HashEntry("14", "15") });

您看过上的文档了吗?是的,但找不到适合我的案例的确切方法。这是我迄今为止尝试的方法,HashEntry[]hashfield=new HashEntry[4]//包含哈希项,redisDB.HashSet(“user”,hashfield);我想StackExchange.Redis的文档放在stackoverflow.com上是有道理的。。。