public async Task <IActionResult> Edit(int id, [Bind("ID,FirstName,LastName,MiddleName,Occupation,PostCode,State,StreetName,StreetNumber,StreetType,Suburb")] Testator testator) { if (id != testator.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(testator); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TestatorExists(testator.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(testator)); }
public async Task <IActionResult> Create([Bind("ID,FirstName,LastName,MiddleName,Occupation,PostCode,State,StreetName,StreetNumber,StreetType,Suburb")] Testator testator) { if (ModelState.IsValid) { _context.Add(testator); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(testator)); }