예제 #1
0
        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));
        }
예제 #2
0
        public async Task <ICollection <PetDTO> > ListAsyncPaged(PetsPaginatedWithOwnerSpecification spec)
        {
            var items = await _petRepository.ListAsync(spec);

            return(items.Select(x => PetDTO.FromPet(x)).ToList());
        }