public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Haine = await _context.Haine.FirstOrDefaultAsync(m => m.ID == id); if (Haine == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Haine = await _context.Haine.FindAsync(id); if (Haine != null) { _context.Haine.Remove(Haine); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }