public async Task <PagedResult <PersonDto> > HandleAsync(BrowsePersons query)
        {
            var pagedResult = await _personRepository.BrowseAsync(query);

            var customers = pagedResult.Items.Select(c => new PersonDto
            {
                Id        = c.Id,
                Email     = c.Email,
                FirstName = c.FirstName,
                LastName  = c.LastName,
                Address   = c.Address,
                Country   = c.Country,
                CreatedAt = c.CreatedAt,
                Completed = c.Completed
            });

            return(PagedResult <PersonDto> .From(pagedResult, customers));
        }
Example #2
0
 public async Task <PagedResult <Person> > BrowseAsync(BrowsePersons query)
 => await _repository.BrowseAsync(_ => true, query);
Example #3
0
 public async Task <ActionResult <PagedResult <PersonDto> > > Get([FromQuery] BrowsePersons query)
 => Collection(await QueryAsync(query));