public IActionResult OnPost(int contactId) { var contact = contactData.Delete(contactId); contactData.Commit(); if (Contact == null) { return(RedirectToPage("./NotFound")); } TempData["Message"] = "The Contact has been succesfully deleted."; return(RedirectToPage("./List")); }
public IActionResult OnPost(int contactId) { var contact = contactData.Delete(contactId); contactData.Commit(); if (contact == null) { return(RedirectToPage("./NotFound")); } TempData["Message"] = $"{contact.Name} deleted"; return(RedirectToPage("./List")); }