public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Idade,CPF,Peso,Altura,Telefone,Nascimento,Sexo")] Toregister toregister) { if (id != toregister.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(toregister); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ToregisterExists(toregister.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(toregister)); }
public async Task <IActionResult> Create([Bind("Id,Name,Idade,CPF,Peso,Altura,Telefone,Nascimento,Sexo")] Toregister toregister) { if (ModelState.IsValid) { _context.Add(toregister); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(toregister)); }