Exemple #1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ExitReason = await _context.ExitReason.FirstOrDefaultAsync(m => m.ErId == id);

            if (ExitReason == null)
            {
                return(NotFound());
            }
            return(Page());
        }
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ExitReason = await _context.ExitReason.FindAsync(id);

            if (ExitReason != null)
            {
                _context.ExitReason.Remove(ExitReason);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }