Zalek Bloom
Zalek Bloom

Reputation: 551

Paging without Entity Framework?

I wrote an MVC C# application which is using a database without Entity Framework. I want to add a paging to my application - most examples of paging I found are using Entity Framework. Can someone point me to examples of paging without EF?

Upvotes: 1

Views: 1629

Answers (1)

Zalek Bloom
Zalek Bloom

Reputation: 551

I just found solution which works for me:

 List<NumberUI> allPages = _repository.GetAllPages();
 int pageSize = 10;
 int totalUserCount = allPages.Count();
 IPagedList<NumberUI> allPagebleNumbers = allPages.ToPagedList(pageNo, pageSize);
 return View(allPagebleNumbers);

zb

Upvotes: 2

Related Questions