public async Task <ListResultOutput <GetTenantListDto> > GetTenantListAsync(GetTenantListInput input) { var list = await _tenantRepository.GetAll() .WhereIf(!input.SearchText.IsNullOrEmpty(), p => p.Name.Contains(input.SearchText)) .OrderBy(input) .Take(input) .ToListAsync(); return(new ListResultOutput <GetTenantListDto>(list.MapTo <List <GetTenantListDto> >())); }
public async Task <JsonResult> GetTenantList(GetTenantListInput input) { var result = await _tenantAppService.GetTenantListAutoCompleteAsync(input); return(Json(result, JsonRequestBehavior.AllowGet)); }
public async Task <ListResultOutput <ComboboxItemDto> > GetTenantListAutoCompleteAsync(GetTenantListInput input) { var list = await _tenantRepository.GetAll() .WhereIf(!input.SearchText.IsNullOrEmpty(), p => p.Name.Contains(input.SearchText)) .OrderBy(input) .Take(input) .ToListAsync(); return (new ListResultOutput <ComboboxItemDto>( list.Select(p => new ComboboxItemDto { Value = p.Id.ToString(), DisplayText = p.Name }).ToList())); }