//get public ActionResult Paricipate(int IdFormation) { var Enfats = new List <EnfantVM>(); Formation f = MyFormationService.GetById((int)IdFormation); IEnumerable <Enfant> pm = MyEnfantService.SearchEnfantByParent("f43c21cf-f35a-4897-a9e3-343c00afe7b2"); foreach (Enfant E in pm) { if ((f.NbrMax > f.Reserved) && (!MyParticipationService.dejaInscrit(E.EnfantId, f.FormationID))) { Enfats.Add(new EnfantVM() { EnfantId = E.EnfantId, Age = E.Age, Image = E.Image, Nom = E.Nom, Prenom = E.Prenom, Sexe = E.Sexe, IdFormation = IdFormation } ); } } return(View(Enfats)); }