Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CacheItem {
- public DateTimeOffset? ExpirationDate { get; set; }
- }
- public void ExpireTheCacheItems()
- {
- allCacheItems
- .Where(x => DateTimeOffset.Now > (x.ExpirationDate ?? DateTimeOffset.Max))
- .ForEach(x => x.Delete());
- }
Add Comment
Please, Sign In to add comment