Beispiel #1
0
        public async Task <IActionResult> DeleteRecipe(int id)
        {
            Recipe recipe = await _recipes_context.Recipe.FindAsync(id);

            if (recipe == null)
            {
                return(NotFound());
            }
            _recipes_context.Remove(recipe);
            await _recipes_context.SaveChangesAsync();

            return(Ok(recipe));
        }