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