public async Task <IActionResult> Edit(long id, [Bind("Id,Nome,Immagine")] Squadre squadre) { if (id != squadre.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(squadre); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SquadreExists(squadre.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(squadre)); }
public async Task <IActionResult> Create([Bind("Id,Nome,Immagine")] Squadre squadre) { if (ModelState.IsValid) { _context.Add(squadre); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(squadre)); }