ÎļþÃû´Ó Service/HStation.Service.Assets.Core/05-service/01-PumpMain/07-PumpMainAndPartMap/Cache/PumpMainAndPartMapCacheHelper.cs ÐÞ¸Ä |
| | |
| | | /// PumpPart |
| | | /// ç¼åè¾
å©ç±» |
| | | /// </summary> |
| | | internal class AssetsPumpMainAndPartMapCacheHelper |
| | | internal class AssetsPumpMainAndPartMappingCacheHelper |
| | | { |
| | | private const string _contentKey = "AssetsPumpMainAndPartMapList"; |
| | | |
| | |
| | | /// <summary> |
| | | /// 设置ç¼å |
| | | /// </summary> |
| | | public static void Set(List<Model.AssetsPumpMainAndPartMap> list, int Minites = 30, int RandomSeconds = 0) |
| | | public static void Set(List<Model.AssetsPumpMainAndPartMapping> list, int Minites = 30, int RandomSeconds = 0) |
| | | { |
| | | var cacheKey = GetCacheKey(); |
| | | MemoryCacheHelper.Set(cacheKey, list, Minites * 60 + RandomSeconds); |
| | |
| | | /// è·åç¼å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<Model.AssetsPumpMainAndPartMap> Get() |
| | | public static List<Model.AssetsPumpMainAndPartMapping> Get() |
| | | { |
| | | var cacheKey = GetCacheKey(); |
| | | return MemoryCacheHelper.Get<List<Model.AssetsPumpMainAndPartMap>>(cacheKey); |
| | | return MemoryCacheHelper.Get<List<Model.AssetsPumpMainAndPartMapping>>(cacheKey); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·å设置ç¼å |
| | | /// </summary> |
| | | public static List<Model.AssetsPumpMainAndPartMap> GetSet(Func<List<Model.AssetsPumpMainAndPartMap>> func, int Minites = 30, int RandomSeconds = 0) |
| | | public static List<Model.AssetsPumpMainAndPartMapping> GetSet(Func<List<Model.AssetsPumpMainAndPartMapping>> func, int Minites = 30, int RandomSeconds = 0) |
| | | { |
| | | var cacheKey = GetCacheKey(); |
| | | return MemoryCacheHelper.GetSet(cacheKey, func, Minites * 60 + RandomSeconds); |