public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.BetItems.Add(Bet);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
示例#2
0
        public async Task <IActionResult> OnPostAsync(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Bet = await _context.BetItems.FindAsync(id);

            if (Bet != null)
            {
                _context.BetItems.Remove(Bet);
                await _context.SaveChangesAsync();
            }

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