public ActionResult GetPastAttendance(DateTime date, int classId) { var attendance = _attendanceRepo.GetAttendanceByDate(classId, date); return(Json(attendance.Select(a => new { a.Date, a.Status, a.Period, a.notes, TeacherSubjectId = a.BCTeacherSubjectId, StudentId = a.StudentClass.BCStudentClassId, a.StudentClass.Student.FirstName, a.StudentClass.Student.LastName, a.StudentClass.BCClassId }), JsonRequestBehavior.AllowGet)); }