示例#1
0
        public async Task <IActionResult> Create([Bind("Id,Title,Ingredients,Directions")] Recipe recipe)
        {
            if (ModelState.IsValid)
            {
                _context.Add(recipe);
                await _context.SaveChangesAsync();

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