public ActionResult SaisirResultats(Guid idEval) { ListeResultatsModels model = new ListeResultatsModels(); using (EvaluationRepository repo = new EvaluationRepository()) { Evaluations e = repo.GetEvaluationById(idEval); if (e == null) { return(HttpNotFound()); } IQueryable <Pupils> pupils = repo.GetPupilsByClassroom(repo.GetClassroomId(e)); EvaluationModels m = new EvaluationModels { id = e.Id, classroomId = e.Classroom_Id, eleves = getListPupils(pupils) }; foreach (var eleve in m.eleves) { ResultatModels r = new ResultatModels { pupilId = eleve.id, pupilName = eleve.firstName + " " + eleve.lastName, evaluationId = m.id }; model.resultats.Add(r); } } model.mode = -1; return(View(model)); }