Пример #1
0
        public async Task HashTestAsync()
        {
            const string key = "person";
            await _redis.HashSetAsync(key, new ConcurrentDictionary <string, string>
            {
                ["name"] = "colin",
                ["age"]  = "18"
            });

            Assert.True(await _redis.HashDeleteFieldsAsync(key, new[] { "gender", "name" }));

            await _redis.HashSetFieldsAsync(key, new ConcurrentDictionary <string, string>
            {
                ["age"] = "20"
            });

            var dict = await _redis.HashGetFieldsAsync(key, new[] { "age" });

            Assert.Equal("20", dict["age"]);

            await _redis.HashDeleteAsync(key);
        }