C# ServiceStack.Redis 操作对象List
时间:
2016-05-05 22:01:25
阅读:
999
评论:
收藏:
0
[点我收藏+]
class Car
{
public Int32 Id { get; set; }
public String Name { get; set; }
}
static void Main(string[] args)
{
RedisClient client = new RedisClient("127.0.0.1", 6379);
client.FlushAll();
client.ChangeDb(0);
var IRCar = client.As();
IRCar.DeleteAll();
var c1 = new Car()
{
Id=1,
Name="东风标致408"
};
IRCar.Store(c1);
List list = new List();
list.Add(c1);
var c2 = new Car()
{
Id = 2,
Name = "东风标致508"
};
list.Add(c2);
var c3 = new Car()
{
Id = 3,
Name = "东风标致308"
};
list.Add(c3);
var c4 = new Car()
{
Id = 4,
Name = "东风标致3008"
};
list.Add(c4);
IRCar.StoreAll(list);
var _list= IRCar.GetAll();
}C# ServiceStack.Redis 操作对象List
原文:http://www.cnblogs.com/zhshlimi/p/5462721.html