Field NoSlidingExpiration
Used as the slidingExpiration
parameter in an Insert method call
to disable sliding expirations. This field is read-only.
Namespace: Alachisoft.NCache.Web.Caching
Assembly: Alachisoft.NCache.Web.dll
Syntax
public static readonly TimeSpan NoSlidingExpiration
Returns
Type | Description |
---|---|
System.TimeSpan |
Remarks
When used, this field sets the slidingExpiration
parameter equal to the System.TimeSpan.Zero
field, which has a constant value of zero. The cached item then expires
in accordance with the absoluteExpiration
parameter.
Examples
The following example demonstrates how to use the Insert method to add an item to the Cache object using the NoSlidingExpiration field.
Cache cache = NCache.InitializeCache("myCache");
cache.Insert("DSN", connectionString, null, DateTime.Now.AddMinutes(2), Cache.NoSlidingExpiration);