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