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()); }
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")); }