//Update public bool UpdateExistingContent(string originalMealName, MenuContent newContent) { //Find the content MenuContent oldContent = GetContentByMealName(originalMealName); //update the content if (oldContent != null) { oldContent.MealName = newContent.MealName; oldContent.DescriptionType = newContent.DescriptionType; oldContent.Ingredientlist = newContent.Ingredientlist; oldContent.MealPrice = newContent.MealPrice; oldContent.TypeOfmeal = newContent.TypeOfmeal; return(true); } else { return(false); } }
//Delete public bool RemoveContentFromList(string mealname) { MenuContent content = GetContentByMealName(mealname); if (content == null) { return(false); } int initialCount = _listOfContent.Count; _listOfContent.Remove(content); if (initialCount > _listOfContent.Count) { return(true); } else { return(false); } }
//Create public void AddContentToList(MenuContent content) { _listOfContent.Add(content); }