| | |
| | | /// <summary> |
| | | /// 设置缓存 |
| | | /// </summary> |
| | | public static void Set(List<Model.AdaptingManage> list, int Minites = 30, int RandomSeconds = 0) |
| | | public static void Set(List<Model.UserDefined> list, int Minites = 30, int RandomSeconds = 0) |
| | | { |
| | | var cacheKey = GetCacheKey(); |
| | | MemoryCacheHelper.Set(cacheKey, list, Minites * 60 + RandomSeconds); |
| | |
| | | /// 获取缓存 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<Model.AdaptingManage> Get() |
| | | public static List<Model.UserDefined> Get() |
| | | { |
| | | var cacheKey = GetCacheKey(); |
| | | return MemoryCacheHelper.Get<List<Model.AdaptingManage>>(cacheKey); |
| | | return MemoryCacheHelper.Get<List<Model.UserDefined>>(cacheKey); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取设置缓存 |
| | | /// </summary> |
| | | public static List<Model.AdaptingManage> GetSet(Func<List<Model.AdaptingManage>> func, int Minites = 30, int RandomSeconds = 0) |
| | | public static List<Model.UserDefined> GetSet(Func<List<Model.UserDefined>> func, int Minites = 30, int RandomSeconds = 0) |
| | | { |
| | | var cacheKey = GetCacheKey(); |
| | | return MemoryCacheHelper.GetSet(cacheKey, func, Minites * 60 + RandomSeconds); |