public async Task <IActionResult> Create([Bind("ID,nome,prezzo,quantita")] Prodotto prodotto) { if (ModelState.IsValid) { _context.Add(prodotto); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(prodotto)); }
public async Task <IActionResult> Create([Bind("repartoId,nome")] Reparto reparto) { if (ModelState.IsValid) { _context.Add(reparto); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(reparto)); }