copy from Service/HStation.Service.Assets.Core/05-service/09-Nozzle/02-ThreeLinkSeries/Cache/NozzleSeriesCacheHelper.cs
copy to Service/HStation.Service.Assets.Core/05-service/04-FourLink/03-AssetsFourCoefficient/Cache/AssetsFourlinkCoefficientCacheHelper.cs
Îļþ´Ó Service/HStation.Service.Assets.Core/05-service/09-Nozzle/02-ThreeLinkSeries/Cache/NozzleSeriesCacheHelper.cs ¸´ÖÆ |
| | |
| | | namespace HStation.Service |
| | | { |
| | | /// <summary> |
| | | /// AssetsSprinklerSeries |
| | | /// AssetsFourlinkCoefficient |
| | | /// ç¼åè¾
å©ç±» |
| | | /// </summary> |
| | | internal class AssetsNozzleSeriesCacheHelper |
| | | internal class AssetsFourlinkCoefficientCacheHelper |
| | | { |
| | | private const string _contentKey = "AssetsNozzleSeriesList"; |
| | | private const string _contentKey = "AssetsFourlinkCoefficientList"; |
| | | |
| | | internal static string GetCacheKey() |
| | | { |
| | |
| | | /// <summary> |
| | | /// 设置ç¼å |
| | | /// </summary> |
| | | public static void Set(List<Model.AssetsSprinklerSeries> list, int Minites = 30, int RandomSeconds = 0) |
| | | public static void Set(List<Model.AssetsFourlinkCoefficient> list, int Minites = 30, int RandomSeconds = 0) |
| | | { |
| | | var cacheKey = GetCacheKey(); |
| | | MemoryCacheHelper.Set(cacheKey, list, Minites * 60 + RandomSeconds); |
| | |
| | | /// è·åç¼å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<Model.AssetsSprinklerSeries> Get() |
| | | public static List<Model.AssetsFourlinkCoefficient> Get() |
| | | { |
| | | var cacheKey = GetCacheKey(); |
| | | return MemoryCacheHelper.Get<List<Model.AssetsSprinklerSeries>>(cacheKey); |
| | | return MemoryCacheHelper.Get<List<Model.AssetsFourlinkCoefficient>>(cacheKey); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·å设置ç¼å |
| | | /// </summary> |
| | | public static List<Model.AssetsSprinklerSeries> GetSet(Func<List<Model.AssetsSprinklerSeries>> func, int Minites = 30, int RandomSeconds = 0) |
| | | public static List<Model.AssetsFourlinkCoefficient> GetSet(Func<List<Model.AssetsFourlinkCoefficient>> func, int Minites = 30, int RandomSeconds = 0) |
| | | { |
| | | var cacheKey = GetCacheKey(); |
| | | return MemoryCacheHelper.GetSet(cacheKey, func, Minites * 60 + RandomSeconds); |