using StackExchange.Redis; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HuanMeng.DotNetCore.Redis; /// /// redis帮助类 /// public class RedisHelper { public RedisHelper(IConnectionMultiplexer redis) { _redis = redis; } private readonly IConnectionMultiplexer _redis; public async Task GetValue(string key) { var db = _redis.GetDatabase(); return await db.StringGetAsync(key); } /// /// /// /// /// public IDatabase GetRedis() { return _redis.GetDatabase(); } }