Пример #1
0
        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());
        }
Пример #2
0
        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"));
        }