【发布时间】:2015-03-06 16:40:17
【问题描述】:
我正在使用简单的ObjectCache 和MemoryCache 类来实现缓存。
public class MemoryCacheManager
{
protected ObjectCache Cache
{
get
{
return MemoryCache.Default;
}
}
/// <summary>
/// Gets or sets the value associated with the specified key.
public virtual T Get<T>(string key)
{
return (T)Cache[key];
}
我想添加方法来检查空缓存但不基于任何键 只想检查整个缓存是否为空,我该怎么做?
【问题讨论】:
-
GetCount() == 0?
标签: c# .net caching memorycache asp.net-caching