示例#1
0
        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"));
        }
示例#2
0
        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"));
        }