public void RedisHashSetEntity() { var customer = new Customer() { Id = "da256fe3-9dc0-46a0-93f3-852a3dbc8dc8", CustomerName = "李四", CustomerAge = 18, CustomerPhone = "1587954569" }; var isTrue = _helper.HashSetEntity("key", customer, e => e.Id); var dictionary = _helper.GetAllHashDictionary <Customer>("key"); var customerResult = _helper.GetHash <Customer>("key", "da256fe3-9dc0-46a0-93f3-852a3dbc8dc8"); Assert.True(isTrue); Assert.True(dictionary.Count > 0); Assert.NotNull(customerResult); }
/// <summary> /// 获取用户名 /// </summary> /// <returns></returns> public string GetUserName(string wxuin) { var tablename = userRedisKey(wxuin); return(_redisHelper.GetHash(tablename, _username_redis_key_)); }