forked from siteserver/cms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPluginCache.cs
More file actions
26 lines (21 loc) · 723 Bytes
/
PluginCache.cs
File metadata and controls
26 lines (21 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using BaiRong.Core;
namespace SiteServer.CMS.Plugin
{
internal static class PluginCache
{
private const string CacheKeyPrefix = "SiteServer.CMS.Core.Plugin.PluginCache.";
public static void ClearCache()
{
CacheUtils.RemoveByStartString(CacheKeyPrefix);
}
public static T GetCache<T>(string cacheName) where T : class
{
if (CacheUtils.Get(CacheKeyPrefix + cacheName) != null) return CacheUtils.Get(CacheKeyPrefix + cacheName) as T;
return null;
}
public static void SetCache<T>(string cacheName, T obj) where T : class
{
CacheUtils.Max(CacheKeyPrefix + cacheName, obj);
}
}
}