public async Task <IActionResult> Edit(int id, [Bind("ID,Nome,NIF,Sexo")] Donos donos) { if (id != donos.ID) { return(NotFound()); } if (ModelState.IsValid) { try { db.Update(donos); await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DonosExists(donos.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(donos)); }
public async Task<IActionResult> Edit(int id, [Bind("ID,Nome,NumCedulaProf,Fotografia")] Veterinarios veterinarios) { if (id != veterinarios.ID) { return NotFound(); } if (ModelState.IsValid) { try { _context.Update(veterinarios); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VeterinariosExists(veterinarios.ID)) { return NotFound(); } else { throw; } } return RedirectToAction(nameof(Index)); } return View(veterinarios); }