示例#1
0
 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()
     });
 }
示例#2
0
 public void RemoveCookbookRecipe(CookbookRecipe cookbookRecipe)
 {
     _unitOfWork.CookbookRecipe.Remove(cookbookRecipe);
 }