views:

356

answers:

3

If you have a Model whose classes are not using LINQ, can you still somehow take advantage and use the IQueryable for use with paging in MVC?

+1  A: 

If all you want is paging in MVC, take a look at MvcContrib's Pager.

Here's some sample code

Mauricio Scheffer
+1  A: 

I use a modified version of Martijn Boland's Html.Pager() helper to generate the actual HTML pager. My Controllers are set up to receive pagesize and page number parameters, and pass those on to my POCO Model factories.

His full control contains IPagedList which wraps IList with everything required for paging. A bit too heavy for my tastes, since I'm doing SQL-side paging anyway.

If you need IQueryable for a specific reason, here's a simple conversion method on IList.

Peter J
+1  A: 

No, but you can still use IEnumerable to implement paging, it will of course, be paging the entire dataset from memory, but since you are not using LINQ thats as good as you get.

FlySwat