• Webinars
  • Docs
  • Download
  • Blogs
  • Contact Us
Try Free
Show / Hide Table of Contents

Property Expiration

Expiration

This property sets Expiration for the cache itme. After the specified timespan, the item expires from cache. If expiration is not set then it is disabled.

Declaration
public Expiration Expiration { get; set; }
Property Value
Type Description
Expiration
Examples

Example sets sliding expiration of a cache item as 5 minutes.

Product product = new Product();
product.Id = 1;
product.Name = "Chai";

CacheItem item = new CacheItem(product);

item.Expiration = new Expiration(ExpirationType.Sliding, TimeSpan.FromMinutes(5));
Back to top Copyright © 2017 Alachisoft