@@ -9,40 +9,40 @@ public class MemoryCacheDefault : IApiOutputCache
99 {
1010 private static readonly MemoryCache Cache = MemoryCache . Default ;
1111
12- public void RemoveStartsWith ( string key )
12+ public virtual void RemoveStartsWith ( string key )
1313 {
1414 lock ( Cache )
1515 {
1616 Cache . Remove ( key ) ;
1717 }
1818 }
1919
20- public T Get < T > ( string key ) where T : class
20+ public virtual T Get < T > ( string key ) where T : class
2121 {
2222 var o = Cache . Get ( key ) as T ;
2323 return o ;
2424 }
2525
2626 [ Obsolete ( "Use Get<T> instead" ) ]
27- public object Get ( string key )
27+ public virtual object Get ( string key )
2828 {
2929 return Cache . Get ( key ) ;
3030 }
3131
32- public void Remove ( string key )
32+ public virtual void Remove ( string key )
3333 {
3434 lock ( Cache )
3535 {
3636 Cache . Remove ( key ) ;
3737 }
3838 }
3939
40- public bool Contains ( string key )
40+ public virtual bool Contains ( string key )
4141 {
4242 return Cache . Contains ( key ) ;
4343 }
4444
45- public void Add ( string key , object o , DateTimeOffset expiration , string dependsOnKey = null )
45+ public virtual void Add ( string key , object o , DateTimeOffset expiration , string dependsOnKey = null )
4646 {
4747 var cachePolicy = new CacheItemPolicy
4848 {
@@ -61,12 +61,12 @@ public void Add(string key, object o, DateTimeOffset expiration, string dependsO
6161 }
6262 }
6363
64- public IEnumerable < string > AllKeys
64+ public virtual IEnumerable < string > AllKeys
6565 {
6666 get
6767 {
6868 return Cache . Select ( x => x . Key ) ;
6969 }
7070 }
7171 }
72- }
72+ }
0 commit comments