public async Task RemoveRecipeWithProduct(int productId) { IEnumerable <Models.Recipe> recipes = context.Recipes.Where(recipe => recipe.Products.Any(product => product.ProductId == productId)); context.RemoveRange(recipes); await context.SaveChangesAsync(); }
private void DeleteAllIngredients(int recipeID) { _context.RemoveRange(this.GetIngredients(recipeID)); }