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