Whats the best way to page data in SubSonic 3 when you need to apply sort and filter? This is what i came to: (Korisnik is User)
var list = String.IsNullOrWhiteSpace(Filter)?Korisnik.All(): Korisnik.All().Where( x => x.Username.Contains(Filter) );
IOrderedQueryable<Korisnik> ordered = list.OrderBy( x => x.Username );
if (Sort == "Username")
ordered = Dir.ToLower() == "asc" ? list.OrderBy(x => x.Username) : list.OrderByDescending(x => x.Username);
else if (Sort == "LastLogin")
ordered = Dir.ToLower() == "asc" ? list.OrderBy(x => x.LastLogin) : list.OrderByDescending(x => x.LastLogin);
var paged = new PagedList<Korisnik>(ordered, StartIndex, Results);
Int32 nResults = ordered.Count();
Thanks for help!