// Use x-www-form-urlencoded to send data public IEnumerable <Resto> Post(Resto toBeInsert) { if (toBeInsert == null) { return(null); } LResto.Add(toBeInsert); PersistJson.SetDatas(LResto); return(LResto); }
public GuiController() { LResto = PersistJson.getDatas(); if (LResto.Count() < 1) { LResto = new List <Resto>(); LResto.Add(new Resto() { Cote = 885, Nom = "Family Burger", Adresse = "Ciney pas très loin d'ici", JourOuverture = new List <string>() { "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi" }, NbPlaces = 52, PrixMoyen = 10 }); LResto.Add(new Resto() { Cote = 982, Nom = "Vivaco", Adresse = "Ciney pas très loin d'ici non plus près de la pompe à essence direction nationale=> marche", JourOuverture = new List <string>() { "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi" }, NbPlaces = 68, PrixMoyen = 26 }); PersistJson.SetDatas(LResto); } }