public async Task <IActionResult> EditTwo(int id, [Bind("ID,FirstName,Surname,LegalSurname,DateOfBirth")] PersonTwo person) { if (id != person.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(person); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PersonExists(person.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(person)); }
public async Task <IActionResult> CreateTwo([Bind("ID,FirstName,Surname,LegalSurname,DateOfBirth")] PersonTwo persontwo) { if (ModelState.IsValid) { _context.Add(persontwo); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(persontwo)); }