using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using IStation.Untity; namespace IStation.Service { /// /// SignalType /// »º´æ¸¨ÖúÀà /// internal class SignalTypeCacheHelper { private const string _contentKey = "SignalTypeListKey"; private static string GetCacheKey() { var contentKey = string.Format("{0}", _contentKey); return CacheHelper.GetCacheKey(contentKey); } /// /// ÉèÖûº´æ /// public static void Set(List list, int Minites = 30, int RandomSeconds = 0) { var cacheKey = GetCacheKey(); MemoryCacheHelper.Set(cacheKey, list, Minites * 60 + RandomSeconds); } /// /// »ñÈ¡»º´æ /// /// public static List Get() { var cacheKey = GetCacheKey(); return MemoryCacheHelper.Get>(cacheKey); } /// /// »ñÈ¡ÉèÖûº´æ /// public static List GetSet(Func> func, int Minites = 30, int RandomSeconds = 0) { var cacheKey = GetCacheKey(); return MemoryCacheHelper.GetSet(cacheKey, func, Minites * 60 + RandomSeconds); } /// /// ÒÆ³ý»º´æ /// public static void Remove() { var cacheKey = GetCacheKey(); MemoryCacheHelper.Remove(cacheKey); } } }