Ejemplo n.º 1
0
        public static RecipeDto ConvertFromRecipe(Recipe recipe)
        {
            RecipeDto recipeDto = new RecipeDto
            {
                Id          = recipe.Id,
                Name        = recipe.Name,
                Description = recipe.Description,
                Picture     = recipe.Picture,
                CoffeeType  = CoffeeHelper.ConvertFromCoffee(recipe.CoffeType)
            };

            return(recipeDto);
        }
Ejemplo n.º 2
0
        public static Recipe ConvertToRecipe(RecipeDto recipeDto)
        {
            Recipe recipe = new Recipe
            {
                Id          = recipeDto.Id,
                Name        = recipeDto.Name,
                Description = recipeDto.Description,
                Picture     = recipeDto.Picture,
                CoffeType   = CoffeeHelper.ConvertToCoffee(recipeDto.CoffeeType)
            };

            return(recipe);
        }