Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        //[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());
        }