init lserp cs 5.0
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using Zhaizj.Framework.Data;
|
||||
using Zhaizj.Framework.DI;
|
||||
using Zhaizj.Framework.Web;
|
||||
|
||||
namespace Zhaizj.Framework.Caching
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 缓存管理器
|
||||
/// </summary>
|
||||
public class CacheManager
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 获取 ApplicationCache
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user