RedisRepository 分享和纠错(6)

using StackExchange.Redis; using System.Threading.Tasks; namespace Fantasy.RedisRepository.RedisHelpers { internal partial class RedisHelper { public async Task<RedisResult> LuaMutilGetHash() { string lua = @"local result={} for i, v in ipairs(KEYS) do result[i] = redis.call('hgetall',v) end return result"; var res = await _client.ScriptEvaluateAsync(lua, new RedisKey[] { "people:1", "people:2", "people:3" }); var res1= LuaScript.GetCachedScriptCount(); return res; } } }

关于Transcation的封装,我个人没有什么好的方法,提供了这样一个方法

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wdppwx.html