I have three tables mapped with the Entity Framework: teachers, classes, and enrollments. I need to show some fields of the teachers and some fields of the classes and show the result in a view using a PagedList if I put it in the following way I get this error:
Error CS1061 'GroupReport' does not contain a definition for 'ToPagedList' and no extension method 'ToPagedList' accepting a first argument of type 'GroupReport' could be found (missing a using directive or an assembly reference?)
using colegio.Datos;
using colegio.Models;
using PagedList;
public ActionResult Index(int? page)
{
const int pageSize = 20;
int pageNumber = (page ?? 1);
var clases = db.claseTs.Include(t => t.aulaT);
var maestros = db.maestroTs.Include(t => t.alumnoT);
var inscripciones = db.inscripcionTs.Include(t => t.membresiaT);
var grupo = new GruopReport();
grupo.clasesT = clases.ToList();
grupo.maestrosT = maestros.ToList();
grupo.inscripcionT = inscripciones.ToList();
return View(grupo.ToPagedList(pageNumber, pageSize));
}