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 (in Alachisoft.NCache.Web.dll) Version: 4.1.0.0 (4.1.0.0)

Syntax

C#
public static readonly TimeSpan NoSlidingExpiration
Visual Basic
Public Shared ReadOnly NoSlidingExpiration As TimeSpan
Visual C++
public:
static initonly TimeSpan NoSlidingExpiration

Remarks

When used, this field sets the slidingExpiration parameter equal to the 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.
CopyC#
Cache cache = NCache.InitializeCache("myCache");
cache.Insert("DSN", connectionString, null, DateTime.Now.AddMinutes(2), Cache.NoSlidingExpiration);

See Also