Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("ID,Dish,Category,Ingredients,Directions,ContainsAlcohol")] Recipe recipe)
        {
            if (ModelState.IsValid)
            {
                _context.Add(recipe);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(recipe));
        }