C# 클래스 Ivony.Caching.MemoryCacheProvider

实现一个使用内存缓存的缓存提供程序
상속: ICacheProvider
파일 보기 프로젝트 열기: Ivony/Ivony.Caching

공개 메소드들

메소드 설명
Clear ( ) : void

清空缓存

Dispose ( ) : void

回收所有非托管资源

Get ( string key ) : object

获取缓存值

MemoryCacheProvider ( string name, Configuration configuration ) : System

创建内存缓存提供程序对象

MemoryCacheProvider ( string name, NameValueCollection configuration = null ) : System

创建内存缓存提供程序对象

Remove ( string cacheKey ) : void

移除指定键的缓存值

Set ( string key, object value, CachePolicyItem cachePolicy ) : void

设置缓存值

비공개 메소드들

메소드 설명
CreateCacheItemPolicy ( CachePolicyItem cachePolicy ) : System.Runtime.Caching.CacheItemPolicy

根据现有缓存策略创建 MemoryCache 的缓存策略

메소드 상세

Clear() 공개 메소드

清空缓存
public Clear ( ) : void
리턴 void

Dispose() 공개 메소드

回收所有非托管资源
public Dispose ( ) : void
리턴 void

Get() 공개 메소드

获取缓存值
public Get ( string key ) : object
key string 缓存键
리턴 object

MemoryCacheProvider() 공개 메소드

创建内存缓存提供程序对象
public MemoryCacheProvider ( string name, Configuration configuration ) : System
name string MemoryCache 的配置名称
configuration Configuration MemoryCache 配置信息
리턴 System

MemoryCacheProvider() 공개 메소드

创建内存缓存提供程序对象
public MemoryCacheProvider ( string name, NameValueCollection configuration = null ) : System
name string MemoryCache 的配置名称
configuration System.Collections.Specialized.NameValueCollection MemoryCache 配置信息
리턴 System

Remove() 공개 메소드

移除指定键的缓存值
public Remove ( string cacheKey ) : void
cacheKey string 缓存键
리턴 void

Set() 공개 메소드

设置缓存值
public Set ( string key, object value, CachePolicyItem cachePolicy ) : void
key string 缓存键
value object 缓存值
cachePolicy CachePolicyItem 缓存策略
리턴 void