Пример #1
0
 public void SortedSetTest()
 {
     // SortedSet操作
     redisHelper.SortedSetAdd("sortedset.sample", new Student {
         Id = 1, Name = "aa", Birthday = DateTime.Now
     }, 10);
     redisHelper.SortedSetAdd("sortedset.sample", new Student {
         Id = 2, Name = "bb", Birthday = DateTime.Now
     }, 9);
     redisHelper.SortedSetAdd("sortedset.sample", new Student {
         Id = 3, Name = "cc", Birthday = DateTime.Now
     }, 15);
     redisHelper.SortedSetRangeByRank <Student>("sortedset.sample").ForEach(s => { Console.WriteLine($"name:{s.Name},id:{s.Id}"); });
 }