????4?????????????

????????????Redis?????????????????????????????á?
????OK???????????????????ɡ???????????demo??
???????
????1.???????????????
public class RedisManager
{
//???????????д????{ get; private set; }  ??????д??
public static PooledRedisClientManager  ClientManager { get; private set; }
static RedisManager()
{
RedisClientManagerConfig redisConfig = new RedisClientManagerConfig();
redisConfig.MaxWritePoolSize = 128;
redisConfig.MaxReadPoolSize = 128;
/*??д???????Redis?????
??????????????????1???????дRedis?????????????????????飬????????????????????
????2???????Redis???????????????????
*/
ClientManager = new PooledRedisClientManager(new string[] {"127.0.0.1"}??
new string[] {"127.0.0.1"}?? redisConfig);
}
}
????2.???????
static void Main(string[] args)
{
using (IRedisClient client = RedisManager.ClientManager.GetClient())
{
//1.??????int????
client.Set<int>("age"??18);
client.Get<int>("age");
//2.??????sting????
client.Set<string>("name"??"jim");
string name = client.Get<string>("name");
//3.??????Dictionary????
Dictionary<string?? string> dict = new Dictionary<string?? string>();
dict.Add("aaa"?? "bbb");
client.Set<Dictionary<string?? string>>("dict"??dict);
client.Get<Dictionary<string??string>>(dict);
//4.???????????Ч???
client.Set<string>("name"?? "rupeng"?? DateTime.Now.AddSeconds(30))
}
}