How do I paginate through a ViewModel in MVC CORE?
问题 In the MVC CORE demo from https://docs.microsoft.com/en-us/aspnet/core/data/ef-mvc/sort-filter-page the Contoso university sample program uses a model on the paginating example page var students = from s in _context.Students select s; return View(await PaginatedList<Student>.CreateAsync(students.AsNoTracking(), page ?? 1, pageSize)); while the viewmodel gets passed back as a complete entity like this var viewModel = new InstructorIndexData(); viewModel.Instructors = await _context.Instructors