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));
        }
Exemple #2
0
        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));
        }