public override async Task <ActionResult <List <AnimalResponse> > > HandleAsync() { var pagedSpecification = new AnimalsPaginatedSpecification(skip: 0, take: 10); var items = await _animalService.ListAsyncPaged(pagedSpecification); var response = AnimalResponse.FromAnimalDTO(items); return(Ok(response)); }
public async Task <ICollection <AnimalDTO> > ListAsyncPaged(AnimalsPaginatedSpecification spec) { var items = await _animalRepository.ListAsync(spec); return(items.Select(x => AnimalDTO.FromAnimal(x)).ToList()); }