JHCache.Set Method (String, Object, DateTime, CacheItemPriority)

DCSoft.DBUtilityGeneric

JHCacheSet Method (String, Object, DateTime, CacheItemPriority)
将指定项添加到 System.Web.Caching.Cache 对象

Namespace: DCSoft.Utility.Web
Assembly: DCSoft.Utility (in DCSoft.Utility.dll) Version: 0.0.0.0 (1.0.0.0)
Syntax
C#
public static bool Set(
	string key,
	Object value,
	DateTime absoluteExpiration,
	CacheItemPriority priority
)

Parameters

key
Type: SystemString
缓存键
value
Type: SystemObject
缓存值
absoluteExpiration
Type: SystemDateTime
所添加对象将到期并被从缓存中移除的时间
priority
Type: System.Web.CachingCacheItemPriority
对象的相对成本,由 System.Web.Caching.CacheItemPriority 枚举表示。缓存在退出对象时使用该值;具有较低成本的对象在具有较高成本的对象之前被从缓存移除

Return Value

Type: Boolean
返回一个值,该值指示缓存是否设置成功
See Also