Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        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"));
        }
Esempio n. 3
0
        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());
        }