using ServiceStack.Redis; using System; using System.Collections.Generic; using System.Text; namespace CC.Yi.Common.Cache { public class RedisCache : ICacheWriter { private RedisClient client; public RedisCache() { client = new RedisClient("127.0.0.1", 6379, "52013142020."); } public bool AddCache(string key, T value, DateTime expDate) { return client.Add(key, value, expDate); } public bool AddCache(string key, T value) { return client.Add(key, value); } public bool RemoveCache(string key) { return client.Remove(key); } public T GetCache(string key) { return client.Get(key); } public bool SetCache(string key,T value, DateTime expDate) { return client.Set(key, value, expDate); } public bool SetCache(string key, T value) { return client.Set(key, value); } } }