Exemple #1
0
        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());
        }
Exemple #2
0
        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"));
        }