public async Task <ActionResult> Index(GetAllPersonInput input) { var output = await _personAppService.GetAll(input); var model = new IndexViewModel(output.Items); return(View(model)); }
public async Task <ListResultDto <PersonListDto> > GetAll(GetAllPersonInput input) { var persons = await _personRepository .GetAll() .WhereIf(!input.Name.IsNullOrEmpty(), t => t.Name.Contains(input.Name)) .OrderByDescending(t => t.CreationTime) .ToDynamicListAsync(); return(new ListResultDto <PersonListDto>(ObjectMapper.Map <List <PersonListDto> >(persons))); }