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