// GET: LeaveRequests/Edit/5 public IActionResult Edit(long?id) { if (id == null) { return(NotFound()); } var leaveRequest = leaveRequestRepository.GetEdit(id); if (leaveRequest == null) { return(NotFound()); } ViewData["LeaveTypeId"] = new SelectList(leaveTypeRepository.GetLeaveTypeList(), "Id", "TypeName", leaveRequest.LeaveTypeId); return(View(leaveRequest)); }
// GET: LeaveRequests/Edit/5 public IActionResult Edit(long?id) { if (id == null) { return(NotFound()); } //var leaveRequest = await _context.LeaveRequests.FindAsync(id); var leaveRequest = leaveRequestRepository.GetEdit(id); if (leaveRequest == null) { return(NotFound()); } ViewData["LeaveTypeId"] = new SelectList(leaveTypeRepository.GetLeaveTypeList(), "Id", "Id", leaveRequest.LeaveTypeId); return(View(leaveRequest)); }