using System;
|
using System.Collections.Generic;
|
using System.Configuration;
|
using System.Linq;
|
using System.Web;
|
|
namespace IStation.Application
|
{
|
/// <summary>
|
/// 缓存辅助类
|
/// </summary>
|
public class CacheHelper
|
{
|
/// <summary>
|
/// 一级缓存
|
/// </summary>
|
public static int CacheLevel1
|
{
|
get
|
{
|
if (_cachelevel1 == null)
|
{
|
_cachelevel1 = Settings.MemoryCache.Level1;
|
}
|
return _cachelevel1.Value;
|
}
|
}
|
private static int? _cachelevel1;
|
|
/// <summary>
|
/// 二级缓存
|
/// </summary>
|
public static int CacheLevel2
|
{
|
get
|
{
|
if (_cachelevel2 == null)
|
{
|
_cachelevel2 = Settings.MemoryCache.Level2;
|
}
|
return _cachelevel2.Value;
|
}
|
}
|
private static int? _cachelevel2;
|
|
/// <summary>
|
/// 三级缓存
|
/// </summary>
|
public static int CacheLevel3
|
{
|
get
|
{
|
if (_cachelevel3 == null)
|
{
|
_cachelevel3 = Settings.MemoryCache.Level3;
|
}
|
return _cachelevel3.Value;
|
}
|
}
|
private static int? _cachelevel3;
|
|
/// <summary>
|
/// 四级缓存
|
/// </summary>
|
public static int CacheLevel4
|
{
|
get
|
{
|
if (_cachelevel4 == null)
|
{
|
_cachelevel4 = Settings.MemoryCache.Level4;
|
}
|
return _cachelevel4.Value;
|
}
|
}
|
private static int? _cachelevel4;
|
|
/// <summary>
|
/// 五级缓存
|
/// </summary>
|
public static int CacheLevel5
|
{
|
get
|
{
|
if (_cachelevel5 == null)
|
{
|
_cachelevel5 = Settings.MemoryCache.Level5;
|
}
|
return _cachelevel5.Value;
|
}
|
}
|
private static int? _cachelevel5;
|
|
|
}
|
}
|