public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } CapacitationPlan = await _context.CapacitationPlan.FirstOrDefaultAsync(m => m.CapacitationPlanId == id); if (CapacitationPlan == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } CapacitationPlan = await _context.CapacitationPlan.FindAsync(id); if (CapacitationPlan != null) { _context.CapacitationPlan.Remove(CapacitationPlan); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }