Esempio 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));
        }
Esempio 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());
        }