Exemple #1
0
        public async Task OnGetApplicationsAsync(int jobId, int currentPage)
        {
            var job = await _jobsService.GetByIdAsync <JobsViewModel>(jobId);

            string[] items = job.resumeFilesId.Split(',');

            var entity = _resumeService.GetAllAsNoTrackingMapped().Where(x => (((IList)items).Contains(x.Id.ToString())));

            Count = await entity.CountAsync().ConfigureAwait(false);

            CurrentPage = currentPage == 0 ? 1 : currentPage;

            if (CurrentPage > TotalPages)
            {
                CurrentPage = TotalPages;
            }

            var result = entity
                         .OrderByDescending(x => x.Id)
                         .Skip((CurrentPage - 1) * PageSize)
                         .Take(PageSize)
                         .AsQueryable()
                         .ToAsyncEnumerable();

            //   ApplicationsList = Count > 0 ? result : null;
            ViewData["Applications"] = Count > 0 ? result : null;
        }