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);