Esempio n. 1
0
        public static RecipeBookDto ConvertFromRecipeBook(RecipeBook recipeBook)
        {
            RecipeBookDto recipeBookDto = new RecipeBookDto
            {
                Id          = recipeBook.Id,
                Name        = recipeBook.Name,
                Description = recipeBook.Description,
                Recipes     = RecipeHelper.ConvertFromRecipes(recipeBook.Recipes)
            };

            return(recipeBookDto);
        }
Esempio n. 2
0
        public static RecipeBook ConvertToRecipeBook(RecipeBookDto recipeBookDto)
        {
            RecipeBook recipeBook = new RecipeBook
            {
                Id          = recipeBookDto.Id,
                Name        = recipeBookDto.Name,
                Description = recipeBookDto.Description,
                Recipes     = RecipeHelper.ConvertToRecipes(recipeBookDto.Recipes)
            };

            return(recipeBook);
        }