Example #1
0
        /// <summary>
        /// Method to delete a recipe
        /// </summary>
        /// <param name="recipe">The recipe to delete</param>
        public async Task DeleteRecipeAsync(ComboBox recipe)
        {
            var isValid = ValidationObject.ValidateRecipeSelection(recipe);


            if (isValid)
            {
                var recipeToDelete = recipe.SelectedItem as RecipeDTO;
                var deleted        = await BusinessObject.DeleteRecipeAsync(recipeToDelete);

                if (deleted)
                {
                    ShowMessage($"Recipe {recipeToDelete.Name} Deleted Successfully");
                }
                else
                {
                    ShowMessage($"Recipe {recipeToDelete.Name} Not Deleted");
                }
            }
        }