예제 #1
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(Covid19AttestationModel).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!Covid19AttestationModelExists(Covid19AttestationModel.XainportId))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
예제 #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"));
        }