상속: Decision.ViewModel.Common.BaseSearchRequest
예제 #1
0
 public virtual async Task<ActionResult> ListAjax(AddressSearchRequest request)
 {
     if (!_referentialTeacherService.CanManageTeacher(request.TeacherId)) return HttpNotFound();
     var viewModel = await _addressService.GetAddressesAsync(request);
     if (viewModel.Addresses == null || !viewModel.Addresses.Any()) return Content("no-more-info");
     return PartialView(MVC.Address.Views._ListAjax, viewModel);
 }
예제 #2
0
 public async Task<AddressListViewModel> GetAddressesAsync(AddressSearchRequest request)
 {
     return new AddressListViewModel
     {
         Addresses = await _addresses.AsNoTracking()
             .Where(a => a.ApplicantId == request.ApplicantId)
             .ProjectTo<AddressViewModel>(_mappingEngine)
             .OrderByDescending(a => a.CreatedOn)
             .Skip((request.PageIndex - 1)*5)
             .Take(5)
             .ToListAsync(),
         Request = request
     };
 }
예제 #3
0
 public virtual async Task<ActionResult> ListAjax(AddressSearchRequest request)
 {
     var viewModel = await _addressService.GetAddressesAsync(request);
     if (viewModel.Addresses == null || !viewModel.Addresses.Any()) return Content("no-more-info");
     return PartialView(MVC.Address.Views._ListAjax, viewModel);
 }