public async Task <Result <JobApplicationResponse> > Handle(GetCurrentJobApplication query, CancellationToken cancellationToken)
            {
                var item = await _repository.GetByUsernameAsync(_authenticatedUser.Username);

                var mappedCategory = _mapper.Map <JobApplicationResponse>(item);

                return(Result <JobApplicationResponse> .Success(mappedCategory));
            }
        public async Task <PaginatedResult <JobApplicationsResponse> > Handle(GetAllCandidatesQuery request, CancellationToken cancellationToken)
        {
            var userName = _authenticatedUser.Username;

            var company = await _companyRepository.GetByUserNameAsync(userName);

            Throw.Exception.IfNull(company, "Company", "No Company Found");


            Expression <Func <JobApplied, JobApplicationsResponse> > expression = e => new JobApplicationsResponse
            {
                UserName = e.UserName,
            };
            var paginatedList = await _repository.JobApplieds
                                .FilterCurrentCompany(company.Id)
                                .Search(request.KeySearch)
                                .Sort(request.OrderBy)
                                .Select(expression)
                                .ToPaginatedListAsync(request.PageNumber, request.PageSize);


            foreach (var data in paginatedList.Data)
            {
                var tmp = data.UserName;

                var user = await _userManager.FindByNameAsync(data.UserName);

                var job = await _jobApplicationRepository.GetByUsernameAsync(data.UserName);

                if (user != null)
                {
                    data.UserFirstName = user.FirstName;
                    data.UserLastName  = user.LastName;
                    data.UserAvatarUrl = user.AvatarUrl;
                }

                if (job != null)
                {
                    data.CurrentPosition   = job.CurrentPosition;
                    data.CurrentPositionId = job.CurrentPositionId;
                    data.Degree            = job.Degree;
                    data.DegreeId          = job.DegreeId;
                    data.ExperienceId      = job.ExperienceId;
                    data.Experience        = job.Experience;
                    data.JobType           = job.JobType;
                    data.JobTypeId         = job.JobTypeId;
                }
            }


            return(paginatedList);
        }