// GET: EmployeeInfoes/Edit/5 public IActionResult Edit(long?id) { if (id == null) { return(NotFound()); } // var employeeInfo = await _context.EmployeeInfos.FindAsync(id); var employeeInfo = employeeInfoRepository.GetEdit(id); if (employeeInfo == null) { return(NotFound()); } ViewData["BranchId"] = new SelectList(branchRepository.GetBranchList(), "Id", "Id", employeeInfo.BranchId); ViewData["DepartmentId"] = new SelectList(departmentRepository.GetDepartmentList(), "Id", "Id", employeeInfo.DepartmentId); ViewData["DesignationId"] = new SelectList(designationRepository.GetDesignationList(), "Id", "Id", employeeInfo.DesignationId); return(View(employeeInfo)); }