Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        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"));
        }