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