1
Vote

Add ".Page(pageIndex, pageSize)" method

description

Add ".Page(pageIndex, pageSize)" method to make it easier to perform a ".Skip().Take()" call with the necessary math for paging done internally within the method. While it's simple math, it's still something that is done frequently and could be abstracted away within a reusable method.
public static SQLinq<T> Page<T>(this SQLinq<T> query, int pageIndex, int pageSize)
{
    return query.Skip(pageSize * pageIndex).Take(pageSize);
}

comments