ab56a9bcf7
SVN-Revision: r240
52 lines
1.2 KiB
C#
52 lines
1.2 KiB
C#
/******************************
|
|
* 说明:运行时缓存(下一步数据存放本地版本号控制)
|
|
* 创建人:龚宇超
|
|
* 创建日期:2019-06-10
|
|
* 修改人:
|
|
* 修改日期:
|
|
* 修改备注:
|
|
* 版本:1.0.0.0
|
|
******************************/
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace Lskj.Util
|
|
{
|
|
/// <summary>
|
|
/// 运行时缓存
|
|
/// </summary>
|
|
public static class CacheHelper
|
|
{
|
|
//缓存容器
|
|
private static Dictionary<string, object> mCacheDictionary = new Dictionary<string, object>();
|
|
|
|
/// <summary>
|
|
/// 添加缓存
|
|
/// </summary>
|
|
public static void Add(string key, object value)
|
|
{
|
|
mCacheDictionary.Add(key, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取缓存
|
|
/// </summary>
|
|
public static T Get<T>(string key)
|
|
{
|
|
return (T)mCacheDictionary[key];
|
|
}
|
|
|
|
/// <summary>
|
|
/// 判断缓存是否存在
|
|
/// </summary>
|
|
/// <param name="key"></param>
|
|
/// <returns></returns>
|
|
public static bool Exsits(string key)
|
|
{
|
|
return mCacheDictionary.ContainsKey(key);
|
|
}
|
|
}
|
|
}
|