コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }