public class MemCachedHelper : ICacheHelper { private IMemcachedClient memcachedClient; public MemCachedHelper(IMemcachedClient memcachedClient) { this.memcachedClient = memcachedClient; } public object Get(string key) { return memcachedClient.Get(key); } public void Set(string key, object obj) { memcachedClient.Set(key, obj, int.MaxValue); } public void Set(string key, object obj, int seconds) { memcachedClient.Set(key, obj, seconds); } public void Remove(string key) { memcachedClient.Remove(key); } public void RemoveAllCache() { memcachedClient.FlushAll(); } }
放在类库项目中。那这个MemCachedHelper要如何使用?参数是?
MemCachedHelper cache= new MemCachedHelper (????);
慕工程0101907
相关分类