Redis for .NET 系列之实现分页需求

代码笔记:

                var tableName = "Table1";
                redisClient.AddItemToSortedSet(tableName, "1", 1);
                redisClient.AddItemToSortedSet(tableName, "2", 2);
                redisClient.AddItemToSortedSet(tableName, "3", 3);
                var pageIndex = 1;
                var pageSize = 5 ;
                //分页查询
                var value = redisClient.GetRangeFromSortedSetDesc(tableName, (pageIndex - 1) * pageSize, (pageSize * pageIndex) - 1);

 

posted @ 2016-03-16 16:22  b̶i̶n̶g̶.̶  阅读(448)  评论(0编辑  收藏  举报