public static RecipeDTO ConvertRecipeToDTO(CookbookRecipe recipe) { return(new RecipeDTO { RecipeId = recipe.recipeId, RecipeName = recipe.recipeName, PictureSource = recipe.recipeImage, Ingredients = recipe.Ingredients.OrderBy(i => i.Index).Select(r => r.IngredientText).ToList(), Method = recipe.Instructions.OrderBy(i => i.Index).Select(r => r.InstructionText).ToList() }); }
public void RemoveCookbookRecipe(CookbookRecipe cookbookRecipe) { _unitOfWork.CookbookRecipe.Remove(cookbookRecipe); }