-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathICache.cs
34 lines (28 loc) · 1.08 KB
/
ICache.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Caching;
using System.Text;
using System.Threading.Tasks;
namespace Lu.Caching
{
public interface ICache
{
void AddItem(string key, object value, CacheItemPolicy policy);
void AddItem(string key, object value, DateTimeOffset dateTimeOffset);
void AddItem(string key, object value);
object GetItem(string key);
object GetItem(string key,bool remove);
T GetItem<T>(string key);
T GetItem<T>(string key, bool remove);
void RemoveItem(string key);
Task<bool> AddItemAsync(string key, object value, CacheItemPolicy policy);
Task<bool> AddItemAsync(string key, object value, DateTimeOffset dateTimeOffset);
Task<bool> AddItemAsync(string key, object value);
Task<object> GetItemAsync(string key);
Task<object> GetItemAsync(string key, bool remove);
Task<T> GetItemAsync<T>(string key);
Task<T> GetItemAsync<T>(string key, bool remove);
Task<bool> RemoveItemAsync(string key);
}
}