public ActionResult CSPs_Read([DataSourceRequest] DataSourceRequest request, CSPFilterViewModel filter) { IQueryable <CSP> items = CSP.GetAll(filter.StudentId, filter.TeacherId, filter.SchoolId, filter.SchoolYearId, filter.SubjectId, filter.ClassId).AsQueryable(); DataSourceResult result = items.ToDataSourceResult(request, _item => new { Id = _item.Id, StudentName = _item.StudentName, StudentClass = _item.StudentClass, SchoolName = _item.SchoolName, SubjectName = _item.SubjectName, TeacherNames = _item.TeacherNames, Materials = _item.Materials, SchoolYearName = _item.SchoolYearName, CreatedOn = _item.CreatedOn, CreatedByUserName = _item.CreatedByUserName }); return(Json(result)); }