Skip to content

Commit

Permalink
feat: add CacheItemPolicy for backwards compat
Browse files Browse the repository at this point in the history
  • Loading branch information
alastairtree committed Mar 4, 2018
1 parent ce43ad1 commit 1d71fc0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions LazyCache/CacheItemPolicy.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Linq;
using Microsoft.Extensions.Caching.Memory;

namespace LazyCache
{
[Obsolete(
"CacheItemPolicy was part of System.Runtime.Caching which is no longer used by LazyCache. " +
"This class is a fake used to maintain backward compatibility and will be removed in a later version."+
"Change to MemoryCacheEntryOptions instead")]
public class CacheItemPolicy : MemoryCacheEntryOptions
{
public PostEvictionCallbackRegistration RemovedCallback => PostEvictionCallbacks.FirstOrDefault();
}
}

0 comments on commit 1d71fc0

Please sign in to comment.