Inheritance: Decision.ViewModel.Common.BaseSearchRequest
Exemplo n.º 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);
 }
Exemplo n.º 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
     };
 }
Exemplo n.º 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);
 }