public async Task <IActionResult> OnPost()
        {
            if (ModelState.IsValid == false)
            {
                return(Page());
            }

            await _data.DeletePerson(Person.Id);

            return(RedirectToPage("./All"));
        }
Exemplo n.º 2
0
 public void Delete(int id)
 {
     db.DeletePerson(id);
 }
        public async Task <IActionResult> Delete(int id)
        {
            await _data.DeletePerson(id);

            return(Ok());
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Delete(PersonModel person)
        {
            await _data.DeletePerson(person.Id);

            return(RedirectToAction("Index"));
        }