Guest User

Untitled

a guest
Jan 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. class CacheItem {
  2. public DateTimeOffset? ExpirationDate { get; set; }
  3. }
  4.  
  5. public void ExpireTheCacheItems()
  6. {
  7. allCacheItems
  8. .Where(x => DateTimeOffset.Now > (x.ExpirationDate ?? DateTimeOffset.Max))
  9. .ForEach(x => x.Delete());
  10. }
Add Comment
Please, Sign In to add comment