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