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