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()); }
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()); }
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")); }