public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } PerformerTrackRole = await _context.PerformerTrackRoles .Include(p => p.PerformerRole) .Include(p => p.PerformerTrack).FirstOrDefaultAsync(m => m.PerformerTrackRoleId == id); if (PerformerTrackRole == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } PerformerTrackRole = await _context.PerformerTrackRoles.FindAsync(id); if (PerformerTrackRole != null) { _context.PerformerTrackRoles.Remove(PerformerTrackRole); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } PerformerTrackRole = await _context.PerformerTrackRoles .Include(p => p.PerformerRole) .Include(p => p.PerformerTrack).FirstOrDefaultAsync(m => m.PerformerTrackRoleId == id); if (PerformerTrackRole == null) { return(NotFound()); } ViewData["PerformerRoleId"] = new SelectList(_context.PerformerRoles, "PerformerRoleId", "PerformerRoleId"); ViewData["PerformerTrackId"] = new SelectList(_context.PerformerTracks, "PerformerTrackId", "PerformerTrackId"); return(Page()); }