namespace Yw.Service
{
///
/// DmaSite
/// »º´æ¸¨ÖúÀà
///
internal class DmaSiteCacheHelper
{
private const string _contentKey = "DmaSiteList";
internal static string GetCacheKey()
{
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);
}
///
/// ·¢²¼
///
public static void Publish(string key)
{
var cacheKey = GetCacheKey();
MemoryCacheWipeRelationHelper.Set(key, cacheKey);
}
///
/// ´¥·¢
///
public static void Trigger()
{
var cacheKey = GetCacheKey();
MemoryCacheWipeRelationHelper.Trigger(cacheKey);
}
}
}