public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } CompoEquipe = await _context.CompoEquipe.FindAsync(id); if (CompoEquipe != null) { _context.CompoEquipe.Remove(CompoEquipe); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } CompoEquipe = await _context.CompoEquipe .Include(c => c.equipe) .Include(c => c.licencie).FirstOrDefaultAsync(m => m.ID == id); if (CompoEquipe == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } CompoEquipe = await _context.CompoEquipe .Include(c => c.equipe) .Include(c => c.licencie).FirstOrDefaultAsync(m => m.ID == id); if (CompoEquipe == null) { return(NotFound()); } ViewData["EquipeID"] = new SelectList(_context.Equipe, "ID", "ID"); ViewData["LicencieID"] = new SelectList(_context.Licencie, "ID", "ID"); return(Page()); }