public async Task <IActionResult> OnPost() { if (ModelState.IsValid == false) { return(Page()); } await _data.DeletePerson(Person.Id); return(RedirectToPage("./All")); }
public void Delete(int id) { db.DeletePerson(id); }
public async Task <IActionResult> Delete(int id) { await _data.DeletePerson(id); return(Ok()); }
public async Task <IActionResult> Delete(PersonModel person) { await _data.DeletePerson(person.Id); return(RedirectToAction("Index")); }