Search code examples
c#.netormsubsonic

subsonic 3 active records paging


I am trying to get the 10 latest rows in Subsonic 3.0 Active Records.

I want to page, so I could really use a method like this:

var blogcoll = blog.GetPaged(1, 10);

The problem with the GetPaged() method is that you can't page in a descending order.

Instead of the first 10 id's i want the last 10 id's

Am I missing something?

is there another way?


Solution

  • I came up with this LINQ solution for my problem:

    (page is an integer parameter)

    var blogcoll = blog.All().OrderByDescending(x => x.idBlog).Skip((page - 1) * 10).Take(10).ToList<blog>();