public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Armor = await _context.Armor.FirstOrDefaultAsync(m => m.Id == id); if (Armor == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Armor = await _context.Armor.FindAsync(id); if (Armor != null) { _context.Armor.Remove(Armor); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }