예제 #1
0
        public async Task <IActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var employee = await _context.Employee.SingleOrDefaultAsync(m => m.ID == id);

            if (employee == null)
            {
                return(NotFound());
            }

            PrepareVoivodeshipsAndCountires();
            return(View(EmployeeMapper.MapEmployeeToView(employee, _context)));
        }
예제 #2
0
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var employee = await _context.Employee
                           .SingleOrDefaultAsync(m => m.ID == id);

            if (employee == null)
            {
                return(NotFound());
            }

            return(View(EmployeeMapper.MapEmployeeToView(employee, _context)));
        }