ویومدل جست و جوی سابقه کاری
Inheritance: Decision.ViewModel.Common.BaseSearchRequest
 public virtual async Task<ActionResult> ListAjax(WorkExperienceSearchRequest request)
 {
     if (!_referentialTeacherService.CanManageTeacher(request.TeacherId)) return HttpNotFound();
     var viewModel = await _workExperienceService.GetPagedListAsync(request);
     if (viewModel.WorkExperiences == null || !viewModel.WorkExperiences.Any()) return Content("no-more-info");
     return PartialView(MVC.WorkExperience.Views._ListAjax, viewModel);
 }
        public async Task<WorkExperienceListViewModel> GetPagedListAsync(WorkExperienceSearchRequest request)
        {
            var works = _workExperiences.Include(a => a.CreatedBy).Include(a => a.ModifiedBy).Where(a => a.ApplicantId == request.ApplicantId).AsNoTracking().OrderByDescending(a => a.TenureBeginDate).AsQueryable();
            var selectedCities = works.ProjectTo<WorkExperienceViewModel>(_mappingEngine);
            var resultsToSkip = (request.PageIndex - 1) * 10;
            var query = await selectedCities
                .Skip(() => resultsToSkip)
                .Take(10).ToListAsync();

            return new WorkExperienceListViewModel { SearchRequest = request, WorkExperiences = query };
        }
        public  async Task<WorkExperienceListViewModel> GetPagedListAsync(WorkExperienceSearchRequest request)
        {
            var cities = _workExperiences.Include(a=>a.Creator).Include(a=>a.LasModifier).Include(a=>a.Title).Where(a => a.TeacherId == request.TeacherId).AsNoTracking().OrderByDescending(a => a.TenureBeginDate).AsQueryable();
          
            var selectedCities = cities.ProjectTo<WorkExperienceViewModel>(_mappingEngine);

            var query = await selectedCities
                .Skip((request.PageIndex - 1)*10)
                .Take(10).ToListAsync();

            return new WorkExperienceListViewModel { SearchRequest = request, WorkExperiences = query };
        }
 public virtual async Task<ActionResult> ListAjax(WorkExperienceSearchRequest request)
 {
     var viewModel = await _workExperienceService.GetPagedListAsync(request);
     if (viewModel.WorkExperiences == null || !viewModel.WorkExperiences.Any()) return Content("no-more-info");
     return PartialView(MVC.WorkExperience.Views._ListAjax, viewModel);
 }