public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } BuddingDancer = await _context.BuddingDancer .Include(b => b.Branch) .Include(b => b.Genre).FirstOrDefaultAsync(m => m.BuddingDancerId == id); if (BuddingDancer == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } BuddingDancer = await _context.BuddingDancer.FindAsync(id); if (BuddingDancer != null) { _context.BuddingDancer.Remove(BuddingDancer); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } BuddingDancer = await _context.BuddingDancer .Include(b => b.Branch) .Include(b => b.Genre).FirstOrDefaultAsync(m => m.BuddingDancerId == id); if (BuddingDancer == null) { return(NotFound()); } ViewData["BranchId"] = new SelectList(_context.Branch, "BranchId", "Address"); ViewData["GenreId"] = new SelectList(_context.Genre, "GenreId", "GenreName"); return(Page()); }