public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            PerformerTrack = await _context.PerformerTracks.FindAsync(id);

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

            return(RedirectToPage("./Index"));
        }
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            PerformerTrack = await _context.PerformerTracks
                             .Include(p => p.Performer)
                             .Include(p => p.Track).FirstOrDefaultAsync(m => m.PerformerTrackId == id);

            if (PerformerTrack == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Beispiel #3
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            PerformerTrack = await _context.PerformerTracks
                             .Include(p => p.Performer)
                             .Include(p => p.Track).FirstOrDefaultAsync(m => m.PerformerTrackId == id);

            if (PerformerTrack == null)
            {
                return(NotFound());
            }
            ViewData["PerformerId"] = new SelectList(_context.Performers, "PerformerId", "PerformerId");
            ViewData["TrackId"]     = new SelectList(_context.Tracks, "TrackId", "TrackId");
            return(Page());
        }