码迷,mamicode.com
首页 > Windows程序 > 详细

C# ServiceStack.Redis 操作对象List

时间:2016-05-05 22:03:36      阅读:1440      评论:0      收藏: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

(1)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!