using System;
using Zhaizj.Framework.Data;
using Zhaizj.Framework.DI;
using Zhaizj.Framework.Web;
namespace Zhaizj.Framework.Caching
{
///
/// 缓存管理器
///
public class CacheManager
{
///
/// 获取 ApplicationCache
///
///
public static IApplicationCache GetApplicationCache()
{
String cfgCache = DbConfig.Instance.ApplicationCacheManager;
if (strUtil.IsNullOrEmpty(cfgCache)) return defaultCache();
if (ObjectContext.Instance.TypeList.ContainsKey(cfgCache) == false) return defaultCache();
return ObjectContext.GetByType(cfgCache) as IApplicationCache;
}
private static IApplicationCache defaultCache()
{
return new ApplicationCache();
}
}
}