forked from smartstore/SmartStoreNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNullCache.cs
More file actions
70 lines (60 loc) · 1.5 KB
/
Copy pathNullCache.cs
File metadata and controls
70 lines (60 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
using System;
using SmartStore.Utilities;
namespace SmartStore.Core.Caching
{
/// <summary>
/// Represents a null cache
/// </summary>
public partial class NullCache : ICacheManager
{
private readonly static ICacheManager s_instance = new NullCache();
public static ICacheManager Instance
{
get { return s_instance; }
}
public T Get<T>(string key, Func<T> acquirer, int? cacheTime = null)
{
if (acquirer == null)
{
return default(T);
}
return acquirer();
}
public void Set(string key, object value, int? cacheTime = null)
{
}
/// <summary>
/// Gets a value indicating whether the value associated with the specified key is cached
/// </summary>
/// <param name="key">key</param>
/// <returns>Result</returns>
public bool Contains(string key)
{
return false;
}
/// <summary>
/// Removes the value with the specified key from the cache
/// </summary>
/// <param name="key">/key</param>
public void Remove(string key)
{
}
/// <summary>
/// Removes items by pattern
/// </summary>
/// <param name="pattern">pattern</param>
public void RemoveByPattern(string pattern)
{
}
/// <summary>
/// Clear all cache data
/// </summary>
public void Clear()
{
}
public IDisposable EnterWriteLock()
{
return ActionDisposable.Empty;
}
}
}