@@ -9,40 +9,40 @@ public class MemoryCacheDefault : IApiOutputCache
9
9
{
10
10
private static readonly MemoryCache Cache = MemoryCache . Default ;
11
11
12
- public void RemoveStartsWith ( string key )
12
+ public virtual void RemoveStartsWith ( string key )
13
13
{
14
14
lock ( Cache )
15
15
{
16
16
Cache . Remove ( key ) ;
17
17
}
18
18
}
19
19
20
- public T Get < T > ( string key ) where T : class
20
+ public virtual T Get < T > ( string key ) where T : class
21
21
{
22
22
var o = Cache . Get ( key ) as T ;
23
23
return o ;
24
24
}
25
25
26
26
[ Obsolete ( "Use Get<T> instead" ) ]
27
- public object Get ( string key )
27
+ public virtual object Get ( string key )
28
28
{
29
29
return Cache . Get ( key ) ;
30
30
}
31
31
32
- public void Remove ( string key )
32
+ public virtual void Remove ( string key )
33
33
{
34
34
lock ( Cache )
35
35
{
36
36
Cache . Remove ( key ) ;
37
37
}
38
38
}
39
39
40
- public bool Contains ( string key )
40
+ public virtual bool Contains ( string key )
41
41
{
42
42
return Cache . Contains ( key ) ;
43
43
}
44
44
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 )
46
46
{
47
47
var cachePolicy = new CacheItemPolicy
48
48
{
@@ -61,12 +61,12 @@ public void Add(string key, object o, DateTimeOffset expiration, string dependsO
61
61
}
62
62
}
63
63
64
- public IEnumerable < string > AllKeys
64
+ public virtual IEnumerable < string > AllKeys
65
65
{
66
66
get
67
67
{
68
68
return Cache . Select ( x => x . Key ) ;
69
69
}
70
70
}
71
71
}
72
- }
72
+ }
0 commit comments