public async Task <IActionResult> Create([Bind("BrewID,CreateDate,Name,Description,Style,Yield,OriginalGravity,FinalGravity,ABV")] Brew brew) { if (ModelState.IsValid) { _context.Add(brew); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(brew)); }
public async Task <IActionResult> Create([Bind("IngredientID,Amount,IngredientName,BrewID")] Ingredient ingredient) { if (ModelState.IsValid) { _context.Add(ingredient); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BrewID"] = new SelectList(_context.Brew, "BrewID", "BrewID", ingredient.BrewID); return(View(ingredient)); }
public async Task <IActionResult> Create([Bind("StepID,StepNote,BrewID")] Step step) { if (ModelState.IsValid) { _context.Add(step); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BrewID"] = new SelectList(_context.Brew, "BrewID", "Description", step.BrewID); return(View(step)); }
public async Task <IActionResult> Create([Bind("NoteID,DateLogged,NoteDescription,BrewID")] Note note) { if (ModelState.IsValid) { _context.Add(note); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BrewID"] = new SelectList(_context.Brew, "BrewID", "BrewID", note.BrewID); return(View(note)); }