public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } DjTrack = await _context.DjTracks.FindAsync(id); if (DjTrack != null) { _context.DjTracks.Remove(DjTrack); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } DjTrack = await _context.DjTracks .Include(d => d.Dj) .Include(d => d.Track).FirstOrDefaultAsync(m => m.DjTrackId == id); if (DjTrack == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } DjTrack = await _context.DjTracks .Include(d => d.Dj) .Include(d => d.Track).FirstOrDefaultAsync(m => m.DjTrackId == id); if (DjTrack == null) { return(NotFound()); } ViewData["DjId"] = new SelectList(_context.Djs, "DjId", "DjId"); ViewData["TrackId"] = new SelectList(_context.Tracks, "TrackId", "TrackId"); return(Page()); }