public async Task <ActionResult> MyLeaves(int id)
        {
            var employee = await _userManager.GetUserAsync(User);

            var employeeVM = _mapper.Map <EmployeeVM>(employee);

            try
            {
                var leaveRequests = await _leaveRequestRepo.FindByEmployeeId(employee.Id);

                var leaveRequestsVM = _mapper.Map <List <LeaveRequestVM> >(leaveRequests);

                var leaveAllocations = await _leaveAllocRepo.FindByEmployeeId(employee.Id);

                var leaveAllocationsVM = _mapper.Map <List <LeaveAllocationVM> >(leaveAllocations);
                var model = new EmployeeLeaveRequestsVM
                {
                    RequestingEmployee   = employeeVM,
                    RequestingEmployeeId = employee.Id,
                    LeaveRequests        = leaveRequestsVM,
                    LeaveAllocations     = leaveAllocationsVM
                };
                return(View(model));
            }
            catch {
                var model = new EmployeeLeaveRequestsVM
                {
                    RequestingEmployee   = employeeVM,
                    RequestingEmployeeId = employee.Id,
                    LeaveRequests        = null,
                    LeaveAllocations     = null
                };
                return(View(model));
            }
        }
        public async Task <ActionResult> EmployeeIndex()
        {
            var employeeId      = _userManager.GetUserId(User);
            var leaveRequestObj = await _leaveRequestRepo.GetLeaveRequestsByEmployee(employeeId);

            var leaveAllocationobj = await _leaveAllocationRepo.GetLeaveAllocationsByEmployee(employeeId);

            var leaveAllocationsVm = _mapper.Map <List <LeaveAllocationVM> >(leaveAllocationobj);
            var leaveRequestVm     = _mapper.Map <List <LeaveRequestVm> >(leaveRequestObj);
            var model = new EmployeeLeaveRequestsVM
            {
                LeaveRequests    = leaveRequestVm,
                LeaveAllocations = leaveAllocationsVm
            };

            return(View(model));
        }