コード例 #1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            LottoDrawNumbers = await _context.tblLottoDrawNumbers.FirstOrDefaultAsync(m => m.LottoNumberID == id);

            if (LottoDrawNumbers == null)
            {
                return(NotFound());
            }
            return(Page());
        }
コード例 #2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            LottoDrawNumbers = await _context.tblLottoDrawNumbers.FindAsync(id);

            if (LottoDrawNumbers != null)
            {
                _context.tblLottoDrawNumbers.Remove(LottoDrawNumbers);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }