public async Task <IActionResult> Edit(int id, [Bind("IdVermifugo,Nome,Periodicidade")] Vermifugos vermifugos) { if (id != vermifugos.IdVermifugo) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(vermifugos); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VermifugosExists(vermifugos.IdVermifugo)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(vermifugos)); }
public async Task <IActionResult> Create([Bind("IdVermifugo,Nome,Periodicidade")] Vermifugos vermifugos) { if (ModelState.IsValid) { _context.Add(vermifugos); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(vermifugos)); }