public ActionResult Index() { var model = new GetStoreInfoInput { FilterText = Request.QueryString["filterText"] }; return(View(model)); }
/// <summary> /// 根据查询条件获取库房信息分页列表 /// </summary> public async Task <PagedResultOutput <StoreInfoListDto> > GetPagedStoreInfosAsync(GetStoreInfoInput input) { var query = _storeInfoRepository.GetAll(); //TODO:根据传入的参数添加过滤条件 query = query.Include(i => i.User).WhereIf(!input.FilterText.IsNullOrWhiteSpace(), i => i.StoreCode.Contains(input.FilterText) | i.StoreName.Contains(input.FilterText)); var storeInfoCount = await query.CountAsync(); var storeInfos = await query .OrderBy(input.Sorting) .PageBy(input) .ToListAsync(); var storeInfoListDtos = storeInfos.MapTo <List <StoreInfoListDto> >(); return(new PagedResultOutput <StoreInfoListDto>( storeInfoCount, storeInfoListDtos )); }