//UPDATE public bool UpdateMeal(int id, Cafe newname) { Cafe original = GetMenuItembyId(id); if (original != null) { original.MealId = newname.MealId; original.MealName = newname.MealName; original.Description = newname.Description; original.Ingredients = newname.Ingredients; original.Price = newname.Price; return(true); } else { return(false); } }
//DELETE public bool DeleteMeal(int mealId) { Cafe item = GetMenuItembyId(mealId); if (item == null) { return(false); } int initialCount = _cafeObjectList.Count; _cafeObjectList.Remove(item); if (initialCount > _cafeObjectList.Count) { return(true); } else { return(false); } }
//CREATE public void CreateMeal(Cafe content) { _cafeObjectList.Add(content); }