Esempio n. 1
0
 public void AddRecipe(CreateRecipeViewModel viewModel)
 {
     var recipe = new Recipe();
     recipe.Name = viewModel.Name;
     recipe.Age = viewModel.Age;
     recipe.Email = viewModel.Email;
     recipe.NameOfPlate = viewModel.NameOfPlate;
     recipe.Ingredients = viewModel.Ingredients;
     recipe.HowToDo = viewModel.HowToDo;
     
 }
Esempio n. 2
0
        public void AddRecipe(CreateRecipeViewModel viewModel)
        {
            var recipe = new Recipe();
            recipe.Name = viewModel.Name;
            recipe.Age = viewModel.Age;
            recipe.Email = viewModel.Email;
            recipe.NameOfPlate = viewModel.NameOfPlate;
            recipe.Ingredients = viewModel.Ingredients;
            recipe.HowToDo = viewModel.HowToDo;

            _context.Recipes.Add(recipe);
            _context.SaveChanges();
        }