Exemplo n.º 1
0
        public async Task <IActionResult> OnGetAsync(long?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Rank = await _context.Rank.FirstOrDefaultAsync(m => m.ID == id);

            if (Rank == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> OnPostAsync(long?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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