public ActionResult ExamResults(int id) { StudentExamsVM model = new StudentExamsVM(); Student std = stdRepo.GetById(id); model.FirstName = std.FirstName; model.LastName = std.LastName; List <ExamOfStudent> examList = exStdRepo.GetAll().Where(x => x.StudentID == id).ToList(); foreach (Exam ex in exRepo.GetAll()) { foreach (ExamOfStudent exStd in examList) { if (exStd.ExamID == ex.Id) { model.ExamScoreList.Add(ex.Name, exStd.Score); } } } return(View(model)); }
private void RefreshList() { ExamList = ExamRepo.GetAll(); }