예제 #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;
     
 }
예제 #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();
        }