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的封装,我个人没有什么好的方法,提供了这样一个方法