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

            await _data.DeletePerson(Person.Id);

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

            return(Ok());
        }
예제 #4
0
        public async Task <IActionResult> Delete(PersonModel person)
        {
            await _data.DeletePerson(person.Id);

            return(RedirectToAction("Index"));
        }