Exemplo n.º 1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TuckShop = await _context.TuckShop
                       .Include(t => t.Membership).FirstOrDefaultAsync(m => m.ID == id);

            if (TuckShop == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TuckShop = await _context.TuckShop
                       .Include(t => t.Membership).FirstOrDefaultAsync(m => m.ID == id);

            if (TuckShop == null)
            {
                return(NotFound());
            }
            ViewData["MembershipID"] = new SelectList(_context.Membership, "ID", "FirstName");
            return(Page());
        }
Exemplo n.º 3
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TuckShop = await _context.TuckShop.FindAsync(id);

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

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