???湤???Redis????
???????????? ???????[ 2016/10/27 10:27:25 ] ???????????? .NET
?????????????RedisClient????????nuget????????????nuget?????
???????????????д??InitCache???????????????Щip??port????????password???????????????????д????cs???????д???????????????????????£???Щ???????RedisClient??????????????Socket???????????????????????RedisClient?????????????
????1 public RedisClient();
????2 public RedisClient(RedisEndpoint config);
????3 public RedisClient(string host);
????4 public RedisClient(Uri uri);
????5 public RedisClient(string host?? int port);
????6 public RedisClient(string host?? int port?? string password = null?? long db = 0);
????????Get??Set????????????RedisClient?????????????????????????Set????????????????????????????????????????Ч????
?????????????????ù??????????????????????????????????????key?????????????????????????????????Ч????????????????饗?????????????????е?.net core????е?memecache???涼???????????????redis?????а??
?????????????д??public override void Dispose(bool isfalse)???????????????RedisClient????????????????Dispose????????????????????????????????using()
????>????????湤?????÷???
????????????????????????????湤?????????????????????RedisCache??MemcachedCache??????????ж??????????????????????????????????????????????????棻??????????????????????????newRedisCache()??newMemcachedCache()??????????????????????????????????????????
?????????????????????????????????????????????????????????????????£?
????1 public enum CacheType
????2 {
????3 RedisCache??
????4
????5 MemcachedCache
????6 }
?????????????????????CacheRepository(???湤??)????????巽??Current???′???
????1 public static BaseCache Current(CacheType cacheType = CacheType.RedisCache)
????2 {
????3 var nspace = typeof(BaseCache);
????4 var fullName = nspace.FullName;
????5 var nowspace = fullName.Substring(0?? fullName.LastIndexOf('.') + 1);
????6
????7 return Assembly.GetExecutingAssembly().CreateInstance(nowspace + cacheType.ToString()?? true) as BaseCache;
????8 }
????*??????????????????????????CreateInstance()????????????typeName???????????????????????????????????????????????????????????nowspace????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????*??Assembly.GetExecutingAssembly()?????????????????ó?????·???????????????????Assembly.Load()??????????????????·???????
?????????????????????????????????????????磺CacheRepository.Current(CacheType.RedisCache).SetCache<MoFlightSearchResponse>(keyData?? value)??????????????redis-cli.exe?????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11