public override async Task <ActionResult <List <PetResponse> > > HandleAsync() { var pagedSpecification = new PetsPaginatedWithOwnerSpecification(skip: 0, take: 10); var items = await _petService.ListAsyncPaged(pagedSpecification); var response = PetResponse.FromPetDTO(items); return(Ok(response)); }
public async Task <ICollection <PetDTO> > ListAsyncPaged(PetsPaginatedWithOwnerSpecification spec) { var items = await _petRepository.ListAsync(spec); return(items.Select(x => PetDTO.FromPet(x)).ToList()); }