Skip to content

Instantly share code, notes, and snippets.

@anaisbetts
Created August 31, 2011 23:03
Show Gist options
  • Select an option

  • Save anaisbetts/1184999 to your computer and use it in GitHub Desktop.

Select an option

Save anaisbetts/1184999 to your computer and use it in GitHub Desktop.
class CacheItem {
public DateTimeOffset? ExpirationDate { get; set; }
}
public void ExpireTheCacheItems()
{
allCacheItems
.Where(x => DateTimeOffset.Now > (x.ExpirationDate ?? DateTimeOffset.Max))
.ForEach(x => x.Delete());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment