public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } var employee = await _empoyeeRepository.GetEmployeeById((int)id); if (employee == null) { return(NotFound()); } return(View("Details", employee)); }
//[BindProperty(SupportsGet = true)] //public int Id { get; set; } public IActionResult OnGet(int id) { Employee = _repository.GetEmployeeById(id); if (Employee == null) { return(RedirectToPage(@"/Employees/NotFound")); } return(this.Page()); }