I would like to paginate, but using Skip
and Take
in my LINQ not to fetch all results.
Currently my code looks like this:
public ViewResult Index(int? page)
{
var grupos= from s in db.grupos
select s;
int pageSize = 3;
int pageNumber = (page ?? 1);
return View(grupos.ToPagedList(pageNumber, pageSize));
}
How do I use Skip
and Take
in my LINQ?