public void RemoveDish(string name) { Dishes dishes = new Dishes(GetDishList().ToList()); dishes.DishList.Remove(dishes.DishList.Find(p => p.Name == name)); Serialize <Dishes>(dishes, dishesPath); }
public void AddDish(Dish dish) { IEnumerable <Dish> array = GetDishList(); Dishes dishes = new Dishes(array == null ? new List <Dish>() : array.ToList()); dishes.DishList.Add(dish); Serialize <Dishes>(dishes, dishesPath); }