public List <Resultats> ObtenirLesResultats(int idSondage) { List <Resto> restaurants = ObtientTousLesRestaurants(); List <Resultats> resultats = new List <Resultats>(); Sondage sondage = listeDessondages.First(s => s.Id == idSondage); foreach (IGrouping <int, Vote> grouping in sondage.Votes.GroupBy(v => v.Resto.Id)) { int idRestaurant = grouping.Key; Resto resto = restaurants.First(r => r.Id == idRestaurant); int nombreDeVotes = grouping.Count(); resultats.Add(new Resultats { Nom = resto.Nom, Telephone = resto.Telephone, NombreDeVotes = nombreDeVotes }); } return(resultats); }
public void ModifierRestaurant(Resto id, Resto nom, Resto telephone) { }
public bool RestaurantExiste(string nom) { Resto restoTest = bdd.Restos.FirstOrDefault(resto => resto.Nom == nom); return(restoTest != null ? true : false); }
// GET: Accueil public ActionResult Index() { Resto r = new Resto() {Nom = "La bonne bouffe", Telephone = "06 95 53 72 86"}; return View(r); }