// GET: /Eval/ReadResultats public ActionResult ReadResultats() { IList <ResultatModels> models = new List <ResultatModels>(); using (ResultatRepository repository = new ResultatRepository()) { IQueryable <Results> a = repository.All(); models = repository.All().Select(x => new ResultatModels { id = x.Id, evaluationId = x.Evaluation_Id, note = x.Note, pupilId = x.Pupil_Id }).ToList(); } return(View(models)); }