public BasePizzaList GetBasePizza() { var basePizzas = new BasePizzaList(); using (StreamReader r = new StreamReader("Data/basePizza.json")) { string json = r.ReadToEnd(); basePizzas = JsonConvert.DeserializeObject <BasePizzaList>(json); } return(basePizzas); }
public BasePizza Get(int id) { var basePizzas = new BasePizzaList(); using (StreamReader r = new StreamReader("Data/basePizza.json")) { string json = r.ReadToEnd(); basePizzas = JsonConvert.DeserializeObject <BasePizzaList>(json); } var selectedPizza = basePizzas.basePizzas.Where(x => x.id == id).FirstOrDefault(); return(selectedPizza); }