diff --git a/Yi.Framework.Net6/Yi.Framework.Core/CacheClientDB.cs b/Yi.Framework.Net6/Yi.Framework.Core/CacheClientDB.cs index a5b6c3a3..5142f3e3 100644 --- a/Yi.Framework.Net6/Yi.Framework.Core/CacheClientDB.cs +++ b/Yi.Framework.Net6/Yi.Framework.Core/CacheClientDB.cs @@ -22,19 +22,8 @@ namespace Yi.Framework.Core { this._RedisOptions = redisConnOptions.CurrentValue; } - //public CSRedisClient GetClient() - //{ - // return client; - //} - //private CSRedisClient client=null; - - // 为了以后全链路做准备 - private T TryCatch(MyAction action) { - //Stopwatch sw = Stopwatch.StartNew(); - ////Exception ex = null; - ////bool isError = false; var client2 = new CSRedisClient($"{_RedisOptions.Host}:{_RedisOptions.Prot},password={_RedisOptions.Password},defaultDatabase ={ _RedisOptions.DB }"); T result; try @@ -45,9 +34,7 @@ namespace Yi.Framework.Core { object p = null; result = (T)p; - //isError = true; Console.WriteLine(exinfo); - } finally { @@ -81,5 +68,9 @@ namespace Yi.Framework.Core { return this.TryCatch((u) => u.Set(key, data)); } + public bool AddHash(string key,string field, T data) + { + return this.TryCatch((u)=>u.HSet(key ,field,data)); + } } }