Using a PagedList with a ViewModel ASP.Net MVC

For anyone who is trying to do it without modifying your ViewModels AND not loading all your records from the database. Repository public List<Order> GetOrderPage(int page, int itemsPerPage, out int totalCount) { List<Order> orders = new List<Order>(); using (DatabaseContext db = new DatabaseContext()) { orders = (from o in db.Orders orderby o.Date descending //use orderby, … Read more