// GET: Evenement/Inscription/idParticipant public async Task <IActionResult> Inscription(int id, string texteRecherche) { var repoPa = new RepoParticipants(_repo.Context); var participant = await repoPa.LireAsync(id); if (participant == null) { return(NotFound()); } ViewBag.PaId = id; ViewBag.Participant = participant.ToString(); if (string.IsNullOrEmpty(texteRecherche)) { return(View()); } ViewBag.Filtre = texteRecherche.Trim(); List <Evenement> evenements = _repo.Liste(ViewBag.Filtre); int n = evenements.Count; ViewBag.Resultat = n == 0 ? "Aucune correspondance" : $"{n} événements trouvés"; return(View(evenements)); }
public ParticipantsController(RepoParticipants repo) { _repo = repo; }